How to write a message using console.log()

370 views
Skip to first unread message

Chuck Baker

unread,
Sep 8, 2015, 7:55:35 PM9/8/15
to Chromium-extensions
HI,  I'm a long time Firefox extension developer and am trying to learn how to write extensions in chrome.  I am using the "Getting Started: Building a Chrome Extension" tutorial.  I am playing around with the javascript to get a feel for different WebExtensions APIs.  

I can put a debugging statement in my js to alert some value (i.e., 'alert(someVariable)' and it works as expected.  But when I replace the alert with 'console.log(someVariable)' nothing get displayed in the console.

Am I missing something?  I open the console with CTRL-SHIFT-J and it displays on the right side of the window, but none of my log messages ever appear.

Chuck Baker

unread,
Sep 8, 2015, 8:08:32 PM9/8/15
to Chromium-extensions
ETA:  I forgot to mention that I have the console filter set to 'All'.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/c54d5c10-4fee-42f5-921b-bf8c0aed5a8c%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.

riyansh karani

unread,
Sep 8, 2015, 9:25:38 PM9/8/15
to Chromium-extensions
Is your console.log() method used inside the content script ? Because that changes a lot of things

PhistucK

unread,
Sep 9, 2015, 5:34:41 AM9/9/15
to Chuck Baker, Chromium-extensions
console.log calls in background/event pages can be seen by going to chrome://extensions and clicking on "background page" next to "Inspect views".
console.log calls in browser or page action popups can be seen by right clicking on the browser or page action button and selecting "Inspect popup".
console.log calls in regular extension page (chrome-extensions://.../foo.html) can be seen regularly (press F12).
console.log calls in content scripts can be seen using the console of the page within which the content script runs (press F12 as well).



PhistucK

--
Reply all
Reply to author
Forward
0 new messages