Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

console.log() not working when I load my chrome extension

I am following the basics of creating a chrome extension https://developer.chrome.com/extensions/getstarted I placed a console.log() statement but it won't show up , should I be using some other API to log stuff on console?

like image 833
pingkimberly work Avatar asked Mar 19 '16 21:03

pingkimberly work


Video Answer


1 Answers

No, you should be looking in the right place.

  • A background or event page's console and Dev Tools are accessible through the extension list in Developer mode - there will be a link under the extension listing.

    Extra note: event page's unload will lose the logs for it.

  • A popup page's console and Dev Tools are accessible through right-clicking the action's button and selecting "Inspect popup".

  • A content script's console and Dev Tools are accessible through the normal Dev Tools for the page that the content script executes in.

    Extra note: since a content script executes in a different context, you need to select that context above the console if you want to run commands in it, as opposed to the page itself.

like image 124
Xan Avatar answered Sep 27 '22 22:09

Xan