Large

Simplepedia

By Grant Stavely Last update Jul 16, 2010 — Installed 21,592 times.

Make it work for everyone

in
Subscribe to Make it work for everyone 2 posts, 2 voices



iaindalton User
MozillaX11

Instead of making GreaseKit users fiddle with their source, do something like this:

// Emulate GM_getValue's behavior of returning its second argument for Safari
if (GM_getValue === undefined) {
    function GM_getValue () {
        return arguments[1];
    }
}

var headingFont = GM_getValue('headingFont', "'Helvetica Neue', Helvetica, 'MgOpen Moderna', sans-serif !important;");
var bodyFont = GM_getValue('bodyFont', "'Helvetica Neue', Helvetica, 'MgOpen Moderna', sans-serif !important;");
var user = GM_getValue('user', false);
var color = GM_getValue('color', '#0892D0');
var default_language = GM_getValue('default_language', 'en');
var international = GM_getValue('international', false);

Then use those variables throughout your script. This eliminates a bunch of function calls, which might even speed things up.

This has the added advantage of not using GM_setValue, which makes you unable to change the default values in future versions and have them apply to people who had used older versions. This is the purpose of GM_setValue's second argument.

Also, to give Linux users saner defaults, put something like Vera Sans before Helvetica, which is a raster font on Linuces.

 
auscompgeek User
FirefoxWindows

Hmm... this was what I was thinking after I read through other scripts...
Might make another version of my revised version of Simplepedia. Besides, I wrote it to help GreaseKit and Opera users. :)

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel