How can I open the Google Chrome Console from Java

2019-01-19 10:36发布

This question already has an answer here:

The question might sound weird but I kind of need this to happen. The alternative would be to ask people to press Ctrl+Shift+i but I would prefer to avoid that and just provide a link.

The link would show up in a Chrome Extension so I'm only interested for Google Chrome.

3条回答
爷的心禁止访问
2楼-- · 2019-01-19 10:47

Sorry, not likely to happen (except as a security hole). Your in-page JavaScript is deliberately sandboxed and limited - it can interact with the page, and with the network through AJAX, but it cannot and should not interact with other things that happen in your computer - including the browser.

查看更多
对你真心纯属浪费
3楼-- · 2019-01-19 11:00

It is not clear why you need to provide such link. DevTools is not a tool for the end user. If you don't like keyboard shortcuts, then there is a page chrome://inspect/ which has the list of pages and extensions, and each entry has a link that opens devtools.

Also, you may use remote debugging page which opens devtools in a page. https://developers.google.com/chrome-developer-tools/docs/remote-debugging

查看更多
在下西门庆
4楼-- · 2019-01-19 11:01

Have you tried Firebug Lite. It is an in-browser tool similar to that found in Chrome.

http://getfirebug.com/firebuglite

It will give you most of the capabilities you are looking for (most likely), and will allow you to programmatically enable it and destroy it.

What do you think?

查看更多
登录 后发表回答