Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a script or an extension for adding or removing a web URI from the pages a Greasemonkey extension is enabled for, ie equivalent to adjusting the URIs in the @include lines dynamically with a single click?

I want to do that without going into the Greasemonkey preferences to change the included URIs, directly from the main screen.

If the menu on the Greasemonkey icon could be extended, it would be a sub menu item for each script.

eg. Script Name -> Enable/Disable for Current Page

share|improve this question
    
Hi Brock :), it is equivalent to adding or removing a web URI from the pages a Greasemonkey extension is enabled for, ie adjusting the URIs in the @include lines dynamically with a single click, without having to go into the Grease monkey preferences to change it there. I will edit the question to explain it better. –  vfclists Jan 3 '13 at 23:45
add comment

1 Answer

up vote 1 down vote accepted

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.
share|improve this answer
    
I was hoping it was possible via Greasemonkey. I will search some more and if there isn't a regular Firefox extension capable of that I will create one myself. From my last work on a Greasemonkey script I noticed that Greasemonkey detects changes to a script even if it wasn't opened from the Greasemonkey dialog. –  vfclists Jan 4 '13 at 2:10
    
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, than to roll a whole new extension. –  Brock Adams Jan 4 '13 at 2:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.