6

I am extending Google Chrome with the "chrome.devtools.panels.create" API, it means that I have now some logic in my browser by which I need to debug.

Is there anyway to see the Console log / Debug my DevTools additions?

5
  • 1
    I know you can do Ctrl Shift J (keyboard shortcut for Console) to open a new dev tools window on an existing dev tools window. See if that helps. Commented Jun 19, 2012 at 15:04
  • Ctrl Shift J indeed helps, thanks! Commented Jul 1, 2012 at 13:17
  • damn! this trick used to work, and the last chrome update disables it. Commented Jul 18, 2012 at 11:31
  • 1
    Still works for me. Opens a new dev tools window on the existing dev tools Commented Jul 18, 2012 at 14:57
  • 1
    Great, this indeed helps - so to conclude 1. detach window 2. F12 Commented Jul 19, 2012 at 15:10

2 Answers 2

2

If all you need is console.log you can wrap it up. Actually it works for any other function, not just console.log but here's example for wrapping console.log:

console._log = console.log; console.log = function(){ // you can do whatever you want with arguments, output to div, alert / etc. return console._log.apply(console,arguments); }; 
Sign up to request clarification or add additional context in comments.

Comments

2

You need to eval a script in the inspectedWindow:

chrome.devtools.inspectedWindow.eval('console.log("test")')

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.