Firefox – Applying a Greasemonkey script to a chrome:// Firefox extension

firefoxgreasemonkey

I've written a small Greasemonkey userscript to modify some <a href... GET parameters in an RSS feed to make it more convenient to use. It works fine when I load the RSS page directly in Firefox with the script enabled.

However, when using a Firefox addon RSS aggregator like Brief or Newsfox, the userscript is not applied. It shows No installed scripts run on this page in the GM context menu despite the script being set with an included pages value of * and activating on all normal web pages. I also tried explicitly specifying the addon URL in case * doesn't actually handle potentially unexpected URL schemes like chrome://, but it remained inactive.

My suspicion is that Greasemonkey is disabled for chrome:// URLs, perhaps for security reasons due to them having much more relaxed security than a typical web page. Or perhaps some kind of sandboxing is taking place. Is there any way I can accomplish what I want without having to resort to a web proxy with content adaptation?

Best Answer

This is not possible, by design.

Sadly, Greasemonkey deliberately restricts itself to http:, https:, ftp:, and data: schemes by default.

You can also run on file: or unmht: schemes, or about:blank, if you explicitly set some magic options.

The developers have stubbornly refused to yield on this point, but you can easily fork the Greasemonkey code and remove the chrome: restriction if you wish.

In the source code, you would edit the file isGreasemonkeyable.js to add a line:

case "chrome":

just after the case "data": line. (Then rebuild and install your modified extension).

Related Question