GM log: Difference between revisions

From GreaseSpot Wiki
Jump to navigationJump to search
(Symmetry update)
mNo edit summary
Line 26: Line 26:
:* All properties are optional except [[#message|message]].
:* All properties are optional except [[#message|message]].


[[#Description|top]]
[[#top|top]]
=== Properties ===
=== Properties ===
----
----
Line 35: Line 35:
:* Message to send to the JavaScript error console.
:* Message to send to the JavaScript error console.


[[#Description|top]] | [[#Syntax|back]]''
[[#top|top]] | [[#Syntax|back]]''


== Examples ==
== Examples ==
Line 46: Line 46:
</pre></code>
</pre></code>


[[#Description|top]]
[[#top|top]]


== GM_log and Firebug ==
== GM_log and Firebug ==
Since [https://addons.mozilla.org/en-US/firefox/addon/1843 Firebug] 1.0, <code>extensions.firebug.showChromeMessages</code> must be set to <code>true</code> for GM_log messages to show up in the Firebug console.
Since [https://addons.mozilla.org/en-US/firefox/addon/1843 Firebug] 1.0, <code>extensions.firebug.showChromeMessages</code> must be set to <code>true</code> for GM_log messages to show up in the Firebug console.


[[#Description|top]]
[[#top|top]]


== Notes ==
== Notes ==


[[#Description|top]]
[[#top|top]]
[[Category:API_Reference|G]]
[[Category:API_Reference|G]]

Revision as of 09:17, 8 December 2007

Template:Underscore


Description

This API method allows script authors simple access to logging informational messages in the Error Console.

If you aren't seeing your messages, make sure you navigate to about:config, and change the values of javascript.options.showInConsole and javascript.options.strict to true. This can be helpful for debugging.

Examples | GM_log and Firebug | Notes

Syntax

GM_log( message )

Value: Function
Returns: Nothing
Compatibility: Greasemonkey 0.3b+
Parameters
Properties
message
  • All properties are optional except message.

top

Properties


message

Value: String
Usage: message = "ARGHHH!";
  • Message to send to the JavaScript error console.

top | back

Examples

 GM_log("Hello, World!");
GM_log("Warning, " + someInputField.value + "!");

top

GM_log and Firebug

Since Firebug 1.0, extensions.firebug.showChromeMessages must be set to true for GM_log messages to show up in the Firebug console.

top

Notes

top