Wie kann ein Greasemonkey-Skript die zulässigen URIs anderer Greasemonkey-Skripts dynamisch ändern?

1065
vfclists

Gibt es ein Skript oder eine Erweiterung zum Hinzufügen oder Entfernen eines Web-URIs auf den Seiten, für die eine Greasemonkey-Erweiterung aktiviert ist, dh, dies entspricht einer dynamischen Anpassung der URIs in den @ include-Zeilen mit einem einzigen Klick?

Ich möchte das tun, ohne in die Greasemonkey-Einstellungen zu gehen, um die enthaltenen URIs direkt vom Hauptbildschirm aus zu ändern.

Wenn das Menü des Greasemonkey-Symbols erweitert werden könnte, wäre dies ein Untermenüelement für jedes Skript.

z.B. Script Name -> Enable/Disable for Current Page

1
Hallo Brock :), es entspricht dem Hinzufügen oder Entfernen einer Web-URI auf den Seiten, für die eine Greasemonkey-Erweiterung aktiviert ist, dh, die URIs in den @ include-Zeilen werden mit einem einzigen Klick dynamisch angepasst, ohne in die Grease-Affen-Voreinstellungen gehen zu müssen ändere es dort. Ich werde die Frage bearbeiten, um sie besser zu erklären. vfclists vor 11 Jahren 0

1 Antwort auf die Frage

1
Brock Adams

Greasemonkey scripts cannot do this. They are not allowed to alter the parameters for other scripts. Nor can they even effect their own include, exclude, or disabled settings.

You can try making a feature request for this, or you can fork the Greasemonkey code and use your own build.

Here's what I do, it's close to what you want, and it's not too hard:

  1. Greasemonkey detects edits to the .user.js files in the gm_scripts folder and updates the edited script(s). So:
  2. Make sure Greasemonkey is configured to open your favorite editor. (TextPad is a good one).
  3. Click open the Greasemonkey icon/menu.
  4. Right-click the script file. The file will open in your editor.
  5. Change the @include, @exclude, and/or @match directives to taste.
  6. Save the file, the changes will go into effect with the next page (re)load.
Ich hatte gehofft, dass es via Greasemonkey möglich ist. Ich werde noch etwas suchen und wenn es keine reguläre Firefox-Erweiterung gibt, werde ich selbst eine erstellen. Bei meiner letzten Arbeit an einem Greasemonkey-Skript habe ich festgestellt, dass Greasemonkey Änderungen an einem Skript erkennt, selbst wenn es nicht im Greasemonkey-Dialogfeld geöffnet wurde. vfclists vor 11 Jahren 0
Yes, Greasemonkey detects edits to the file in the `gm_scripts` folder. The recipe was just for an easy-ish way to open the correct file, not a requirement that the file be opened that way. ... Might be easier to fork [the Greasemonkey code](https://github.com/greasemonkey/greasemonkey/tree), than to roll a whole new extension. Brock Adams vor 11 Jahren 0