Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I execute a userscript on a moz-extension page?

I want to execute a userscript on a extension's page.

I am using Greasemonkey, is there a permission, setting, or include filter I can use to execute my user script on an extension's page?

Right now I am including my javascript by editing the html file after unpacking and repacking the extension.

However, I would like to be able to change the script without having to edit the extension itself.

like image 891
John Avatar asked Sep 03 '25 04:09

John


1 Answers

Greasemonkey (and Tampermonkey, Violentmonkey, etc.) are WebExtensions on Firefox. And, The old "add-on" architecture was disabled with Firefox 57 ("Quantum").

WebExtensions are explicitly blocked from operating on (another) extension's pages. (Imagine the fun chaos if extensions could monkey with other extension's pages.)

Refer to the Match patterns Scheme documentation:

  • Extensions may operate only on the http, https, ws, wss, ftp, ftps or file schemes.
  • The moz-extension scheme is not listed.

Note:

  1. mozilla.org pages are also blocked for similar reasons.
  2. Chrome, Opera, etc., all have similar restrictions.
  3. An extension can operate on it's own moz-extension:// pages, but that does not apply for Greasemonkey unless you a developing Greasemonkey itself.
like image 172
Brock Adams Avatar answered Sep 04 '25 23:09

Brock Adams