Proposals of things to implement in Greasemonkey

This page condenses (and refers) topics discussed on the greasemonkey-dev mailing list, that have been up, and might be worth implementing some day -- possibly by you.

On / off callbacks

Enabling scripts to react dynamically to changes in their configuration would enable user actions in the Greasemonkey script manager to propagate to scripts themselves, if the script author chooses to cater such events, and without forcing the user to even reload the page. Some of this can be implemented backwards compatibly via a new event registration system, of some sort, whereas some require the script to opt in by way of new script headers such as @reloadable. Events that could be interesting to react to (assuming an already loaded web page, of any sort):

  • enabledness changed to on by turning all of Greasemonkey on
  • enabledness changed to off by turning all of Greasemonkey off
  • enabledness changed to on by changing the Manager checkbox of a script
  • enabledness changed to off by changing the Manager checkbox of a script
  • enabledness changed to on for this url via altered @include/@exclude rules of a script
  • enabledness changed to off for this url via altered @include/@exclude rules of a script
  • enabledness changed to on for this url via installing a new script with matching @include/@exclude rules
  • enabledness changed to off by way of uninstalling the script

It could also be interesting to listen to the GM equivalent of DOMContentLoaded, that is "all scripts that were set to react for this url (on first init), or event (later), have now been hailed", which would make life a lot easier on scripts cooperating with one another (less dependency on mandatory load orders, which is both hell to teach script users, and to keep track of yourself).