开发者

Context Menu for Directly Loading Chrome's Console

开发者 https://www.devze.com 2023-02-13 10:31 出处:网络
Quick question. I develop a lot of javascript and usually end up accessing the console via right-click, inspect element, and then navigating to the console tab.

Quick question.

I develop a lot of javascript and usually end up accessing the console via right-click, inspect element, and then navigating to the console tab.

I know there are keyboard shortcuts, but I've never really been able to get used to using them.

So, w开发者_如何学Chat I'd like to do is create an extension for Chrome that registers another context menu item that would directly open the JS console. I can register the context menu just fine, but don't know how to get it to actually open the console on click. It may not be possible, but I just wanted to throw it out here to see if anyone has a solution.

Here's what I currently have:

chrome.contextMenus.create(
    {
        "title": "Show Console", 
        "contexts":["page","selection","link","editable","image","video","audio"],
    "onclick": function() {
            alert("working");
        }
    }
);


You cannot do that, there have been talks to do a Inspector API for Chrome. In the meantime you can use the following keyboard shortcut to open inspector:

JavaScript Console: Ctrl + Shift + J

Inspector Console: Ctrl + Shift + I

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号