GM_log and other GM functions do not work in Greasemonkey scripts

I created a "Hello World" Greasemonkey script in Firefox that contains only one line of code:

GM_log("Hello World");

This did not seem to function, at least it did not produce any results in my firebug console.
Same thing with other GM _... features like GM_wait

When I replaced:

GM_log("Hello World");

with:

alert("Hello World")

it worked (so the script headers are not a problem).

I also set the following options about:configto true:

  • javascript.options.showInConsole
  • extensions.firebug.showChromeErrors
  • extensions.firebug.showChromeMessages

Are there any other settings for changing GM _... functions to work in Greasemonkey scripts?

Do I need to change other firebug parameters for GM_log messages to display in the firebug console?

+5
source share
3 answers

GM_wait? GM; . , GM 0.9.19 , 0.9.20.

GM_log(), , . Greasemonkey GM_log() Firefox Error Console, , Ctrl Shift J.
Comentarist, GM_log . .

console.log() ( Firebug), Firefox Firefox Error Console.

Firebug ( ), unsafeWindow :

unsafeWindow.console.clear ();
unsafeWindow.console.log ("Hello World!");
+3

GM_log() :

console.log('hello world');

http://wiki.greasespot.net/GM_log

, " GM_log , Firebug console.log."

, , .

+1

: @grant, GM 1.0. GM_log , script: "// @grant GM_log" , . http://wiki.greasespot.net/@grant.

+1

All Articles