1

I'm trying to modify behavior of an add-on's screen, which has a URL beginning with resource://. So I added a userscript with this setting:

// @include resource://jid0-gxjllfbcoax0lcltedfrekqdqpi-at-jetpack/as-ff/data/edit.html

It doesn't work:

Greasemonkey context menu

I know that besides resource:// and about: there are other pseudo-protocols too. Can Greasemonkey run userscripts on those paths (URIs)?

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
  • As Arantius said, this is not possible. (As he is the controlling developer for the main GM release, that is not likely to change, either.) You can fork the Greasemonkey code (or Scriptish code) and attempt to support that scheme. Or, in this case forget all that and just fork that add-on and make your changes in the HTML file you specified. – Brock Adams Oct 19 '14 at 07:35
  • @BrockAdams yes, I'm trying to do that now. But it's much longer to re-pack and re-install whole addon to test any edit. I'll probably host the script on localhost in the testing phase, so that it's reloaded every time. – Tomáš Zato Oct 19 '14 at 11:53
  • 2
    @TomášZato You do not need to re-pack an add-on to test changes. A)You can create a file in your profile's `extensions` directory. The file can contain a single line with the full path to the top directory of the extension. B)Alternately, you can just unpack it in a sub directory within your profile's `extensions` directory. You can then disable/enable it, or restart Firefox (multiple add-ons provide 1 click restart). – Makyen Oct 20 '14 at 01:22

2 Answers2

1

See Greaseable schemes in the Greasemonkey docs.

Greasemonkey only runs scripts in particular places. I'd strongly suspect that page would be running with chrome privileges, so would be denied even if resource:// was an allowed scheme.

Note that this Q&A was cross posted as Greasemonkey issue 2039.

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
arantius
  • 1,715
  • 1
  • 17
  • 28
  • @TomášZato No, there is no chance of a usr-level workaround. You could write a Firefox add-on which made the modification you desire. Alternately, if the add-on's license permits, you can directly modify the code of the add-on which you are wanting to change. From the "jetpack" in the URL it is a Add-on SDK based Firefox Add-on. Thus, it is highly likely that it is entirely (prior to packaging) JavaScript and HTML. The add-on will be contained in an `.xpi` file whichis just a `.zip` file with the file extension changed. Change the file extension back and unzip it to get the contents. – Makyen Oct 20 '14 at 00:17
  • 1
    Yes I did that. This way, however, other people may not profit from my work, since they will not trust the modified add-on. I am trying to get [AwesomeScreenshot](http://awesomescreenshot.com/) upload images directly to stackoverflow account at Imgur. So far, [I added Imgur uploads](http://imgur.com/UDTYyeb) to the add-on. I'm now struggling with finding out, how to upload directly to stackoverflow account. – Tomáš Zato Oct 20 '14 at 00:33
1

You could try Scriptish which has a setting to enable chrome protocols.

jerone
  • 16,206
  • 4
  • 39
  • 57
  • But not `resource://`... Also, the `chrome://` support [apparently needs a hack to work in the scenarios that the OP needs](http://stackoverflow.com/q/16244648/331508). – Brock Adams Oct 19 '14 at 19:30