< Day Day Up > |
You can disable a user script temporarily, disable all user scripts, or uninstall a user script permanently. Once you have a few user scripts running, you might want to temporarily disable some or all of them. There are several different ways to prevent a user script from running. 1.5.1. Disabling a User Script Without Uninstalling ItThe easiest way to disable a user script is in the Manage User Scripts dialog. Assuming you installed the Butler user script [Hack #1], you can disable it with just a few clicks:
Now, Butler is installed, but inactive. You can verify this by searching for something on Google. It should no longer say "Enhanced by Butler" along the top. You can reenable the Butler user script by repeating the procedure and reselecting the Enabled checkbox in the Manage User Scripts dialog.
1.5.2. Disabling All User ScriptsWhile Greasemonkey is installed, it displays a little smiling monkey icon in the status bar, as shown in Figure 1-5. Figure 1-5. Greasemonkey status bar iconClicking the Greasemonkey icon in the status bar disables Greasemonkey entirely; any user scripts you have installed will no longer execute. The Greasemonkey icon will frown and turn gray to indicate that Greasemonkey is currently disabled, as shown in Figure 1-6. Clicking the icon again reenables Greasemonkey and any enabled user scripts. Figure 1-6. Greasemonkey disabled1.5.3. Disabling a User Script by Removing All Included PagesAs shown in "Master the @include and @exclude Directives" [Hack #3], user scripts contain two sections: a list of pages to run the script and a list of pages not to run the script. Another way to prevent a user script from executing is to remove all the pages on which it runs:
1.5.4. Disabling a User Script by Excluding All PagesYet another way to disable a user script is to add a wildcard to exclude it from all pages:
Now, Butler is still installed and technically still active. But because excluded pages take precedence over included pages, Butler will never actually be executed, because you have told Greasemonkey to exclude it from all pages. 1.5.5. Disabling a User Script by Editing config.xmlAs shown in "Install a User Script" [Hack #1], Greasemonkey stores the list of installed scripts in a configuration file, config.xml, deep within your Firefox profile directory: <UserScriptConfig> <Script filename="butler.user.js" name="Butler" namespace="http://diveintomark.org/projects/butler/" description="Link to competitors from Google search results" enabled="true"> <Include>http://*.google.com/*</Include> </Script> </UserScriptConfig> You can manually edit this file to disable a user script. To disable Butler, find its <Script> element in config.xml, and then set the enabled attribute to false. 1.5.6. Uninstalling a User ScriptFinally, you can remove a user script entirely by uninstalling it:
Butler is now uninstalled completely. |
< Day Day Up > |