1

i try to make some chrome extension, i need debug.

i want use chrome dev tool, console.

enter image description here

I write console.log in code, devtool is just clear.

like this.

function doExportToDisk() {
    console.log("es on. ");
}

i search on google, i found this.

function doExportToDisk() {
  var bkg = chrome.extension.getBackgroundPage();
  bkg.console.log('foo');
}

but is dosen't work, too. now i use aleat. but it's too Inconvenience.

chrome.tabs.executeScript({
    code: "console.log('loads');
}, callbackFindIDsFromPage);

this is work. but it's so Limited. i want use powerful log. help!

Redwings
  • 540
  • 2
  • 4
  • 12
  • Can you not use the dropdown where it says `top` and find your extension there, it seems like that would show you the console logs then – George Nov 23 '18 at 15:27
  • @George i can find it. but i select, change anything. you mean change 'top' to extenstion name, right? – Redwings Nov 23 '18 at 15:29
  • 1
    The popup is a separate window, which has a separate devtools - right-click the popup and click "Inspect". More info: [Google Chrome / Firefox do not see extension output in console](//stackoverflow.com/a/38920982) – wOxxOm Nov 23 '18 at 15:32
  • It's been a while since I created a chrome extension. You could add a div to the page and put your logs in that. If you make it position absolute and give it a high z-index, that will work. – Graham Nov 23 '18 at 15:33
  • @ wOxxOm OMG... i never thought that! you save me! thanks!!! can you teach me how to select answer your comment? – Redwings Nov 23 '18 at 15:33

0 Answers0