I want to add a default entry to the meta data for the new Greasemonkey script.
Currently, when you use the New Users ... menu, you get a dialog like this (I need Minimum-Required Field was filled in, and the clipboard was empty): How do I change the default instructions? I see, which is the right way to handle this long term. To fix a quick and dirty, temporary - which will only work for you and only update to the next Greasemonkey, you can do the following: Just before line 124, To prevent common problems with default GM scripts, Restart Firefox changes should be effective. A slightly less problematic approach, if you have the skills, then this is: (1) fork, (2) Change this would be: Documented, less risky, more permanent, and will allow you to switch fast between GM and your own version. If you have even more skills, then you add a custom-metadata feature to the code, GM, and start a pull-request. It contains a little more. < / Html> < / P>
This gives a new script like this: // == Userscript == // @name _Sample Default Greasemonkey script // @ namespace _pc / / @ Included http://stackoverflow.com/questions/* // @ version1 // == / UserScript ==
But, I @require jquery and a
@ author
field on each default script, so it Default code will appear like this :
// == Userscript == // @name _Sample Default Greasemonkey script // @ namespace _pc // @ contains http: // Stackoverflow.com/questions/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js // @author me // @ version1 // == / Users ==
How can I do this? When I edit greasemonkey.jar (in the folder extension), and add the line: @require http: // [link from jquery to google] This does not work and problems opening Greasemonkey Are (a ¿file?).
extension sub folder and it is usually
{e4a8a97b-f2ed-450b-b12d-ee082ba24781} .xpi .
.xpi file.
content \ newscript.js .
script.push ("// @version 1"); , add the following lines:
script.push ("//require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery Min.js "); Script push ("// @ author"); Script.push ("// @grant GM_addStyle");
GM_addStyle is bits - especially those that add jQuery.
newscript.js to the
.xpi file.
Precautions:
.xpi files such as you corrupt your Firefox profile If you are not careful!
newscript.js , as I have described above, (3) change the extension ID, and (4) install your foky version
No comments:
Post a Comment