How can you access the web console from Greasemonkey userscripts? First of all, you should not do this in production. However, logging to the web console can be a useful tool during development.
Here’s how you do it:
// Put this at the top of your userscript var console = unsafeWindow.console;
Bonus: How to access your userscript’s jQuery from the web console
// Expose userscript's jquery to the web console unsafeWindow.$ = $;
Again, do not do this in production.