printf debugging in GreaseMonkey without the modal dialog box of alert():
- You can use GM_log, which logs messages to the Error Console.
- With the Firebug extension, you can do e.g.
console.log("Link: %o", document.links)to log messages and inspect elements. Don't forget to remove the Firebug code before distributing the script.
- You can use dump() statements to print debugging info to the Firefox console.
- You can set
window.status = message_string, understanding that the status bar text is transient: many other processes within Firefox set it.