Incredibly detailed guide, Emylbus! Good job making this for this community, because a lot of people have been wondering how to make these userscripts!
Very detailed, very nice layout and a good read! Thanks for making and sharing this!
Thanks for this man! Awesome tutorial!
Dude you could defiantly off programming lessons to people who don't know how but want to learn.
Awesome tutorial mate! I'll bookmark this for further reference.
Very nice.
Bookmarked for future scripts :D
Emylbus, damn you are amazing O_O...
This is fucking amazing OP, if i could rep i would rep you. I see you put alot of time and effort into this. And i made a Logo change now C:
Amazing Thread, in my eyes, it deserves a sticky!
(Jul 27, 2013 02:43 PM)XilluX Wrote: Amazing Thread, in my eyes, it deserves a sticky!
If we only had an userscript section 🤫
(Jul 21, 2013 12:07 PM)Emylbus Wrote: PHP Code
<?php // ==UserScript== // @name HF Enhancement Suite // @author Emylbus // @namespace http://www.sublyme.net // @description This userscript defines general enhancement tweaks that apply to the entire HackForums site. // @include *hackforums.net/* // @version 0.32 // @updateURL http://sublyme.net/site_media/userscripts/HFES.user.js // @grant GM_addStyle // @grant GM_xmlhttpRequest // @grant GM_getValue // @grant GM_setValue // @grant GM_log // @require http://github.com/sizzlemctwizzle/GM_config/raw/master/gm_config.js // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js // @require http://sublyme.net/site_media/userscripts/GM_SuperValues.user.js // ==/UserScript==
If you're going to link to my library (GM_config) and not mention it, the least you could do is link to the wiki.
(Sep 2, 2013 02:32 PM)Emylbus Wrote: I didn't mention it in this thread because it doesn't discuss this plugin. I'll link to the wiki in the release thread of my script.
I figured since you mentioned the other two libraries used in that script in this thread, you might as well mention mine (I think it's something that many user script devlopers would find useful). You don't need to link the wiki in the release thread since that thread is about your script and not user script development.
Also,
(Jul 21, 2013 12:07 PM)Emylbus Wrote: - @updateURL
- Define where the userscript manager will download updates from.
PHP Code
<?php // @updateURL http://www.example.org/example.meta.js
That isn't exactly correct. @updateURL defines where to check for updates (i.e parse the metadata and compare the version number with the installed script). If an update is found it is downloaded from the location specified by @downloadURL.
Source: I implemented user script updating in Greasemonkey.
(Sep 2, 2013 06:42 PM)Emylbus Wrote: Also the documentation for GM_Config is pretty abysmal. If there's a decent place that explains every possible option for it, please let me know.
All the documentation you could ever want is in the wiki. Here's a link to the full list of pages. The fields page is probably what you're really looking for.
(Sep 2, 2013 06:42 PM)Emylbus Wrote: In addition to this, there are two versions (yours and JoeSimmons) which leads to confusion.
https://github.com/sizzlemctwizzle/GM_co...scriptsorg
(Sep 2, 2013 07:18 PM)Emylbus Wrote: Thanks, I had been looking for a list of fields for a long time now
Truth be told, the detailed documentation is pretty new. GM_config has been around since '09 and until recently the only way of knowing what was possible was looking at either GM_config's source or existing scripts using GM_config. Hopefully with the new documentation more people will decide to use it, rather than trying to build their own settings panel from scratch.
Since you're already using GM_config, you can also implement GM_SuperValue like this:
PHP Code
<?php var GM_SuperValue = new function () { this.set = function(name, val) { GM_config.setValue(name, GM_config.stringify({'val': val})); };
this.get = function(name, def) { var rval = GM_config.getValue(name, def); return rval === def ? rval : GM_config.parser(rval).val; }; };
It has the advantage of working in user script environments that don't have GM_setValue/GM_getValue. GM_config uses localStorage as a fallback and will run in pretty much any modern browser (in fact, here is a web page that it runs on without any modification). The only downside of using the above code is that you can't store functions, but that only works in Firefox (last time I checked) and I don't know why the hell you'd want to do that anyway.
|