Is there a easy way to do this. And is there anything that needs to be changed due to differences in how it is ran?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The easiest way to do this:
Run the bookmarklet code through a URL decoder. so that
javascript:alert%20('Hi%20Boss!')%3B, for example, becomes:javascript:alert ('Hi Boss!');Strip the leading
javascript:off. Result:alert ('Hi Boss!');Add this code to the end of your Greasemonkey file. For example, create a file named,
Hello World.user.js, with this code:
Open Hello World.user.js with Firefox (CtrlO ). Greasemonkey will prompt to install the script.
Now the bookmarklet code will run automatically on whatever pages you specified with the
@includeand@excludedirectives.Update: To ensure maximum compatibility, use the
@grant nonedirective that was added in later versions of Greasemonkey and Tampermonkey.IMPORTANT:
The userscript will run much sooner than you could ever activate a bookmark. Normally, this is not a problem.
But in some cases, you might need to wait for some part of the page to fully load.
In that case, you can use techniques/utilities like waitForKeyElements.
See also, Choosing and activating the right controls on an AJAX-driven site .
If you still can’t get your new script to work, be sure to read My very simple Greasemonkey script is not running?. Follow the steps and include the specified information in any question you open about problems with the new script.