Using FireBug’s console logger with GreaseMonkey 0.6.4

FireBug is the best tool (a Firefox extension) for web development ever invented … well, advice at least one of the best.

The console method  (formerly known as printfire) is a feature of FireBug that enables logging into firebug’s console with different levels. Thing is – it does not quite work with GreaseMonkey scripts. Until now!

The solution is very simple – using GM’s unsafeWindow object. This object is the same as the ‘window’ object that local javascript is seing, diagnosis and it includes firebug console methods.

Like so:

unsafeWindow.console.info('some informational message');

One thought on “Using FireBug’s console logger with GreaseMonkey 0.6.4

Leave a Reply

Your email address will not be published. Required fields are marked *