Greasy Fork is available in English.

Discuții » Parere despre Geasy Fork

Custom script variables on the Install page

woxxomMod
§
Postat în: 14-02-2015

Custom script variables on the Install page

It'd be nice to have custom variables on the Install page like on userstyles.org:

var someColor = /*[[optionColor]]*/;
var someText = /*[[optionText]]*/;
............
someElement.style.setProperty('color', someColor);
someElement.textContent = someText;
...........

This will benefit a lot of simple scripts that don't have their own setup dialogs and it'll make GreasyFork the best script repository.

§
Postat în: 28-02-2015

See it the same way ... You can include such things as options for your script and if you install the script from any other place, it's not possible to provide such features.

§
Postat în: 17-03-2015

What will happen when script auto updating, especially without script host supporting this feature? What about new version comes up with some new features or new options? How can a user change his settings without loos GM_setValue?

How to show source code to user? how to make user be able to check the source code? Will some malicious code such as auto follow or send cookies to author's server hide behind settings?

Also, I think there should be some default values, so that install codes without setting should works, like following one or something else.


    var someColor = /*[[optionColor]*/'#fff'/*[optionColor]]*/;
    var someText = /*[[optionText]*/'Hello'/*[optionText]]*/;
    ............
    someElement.style.setProperty('color', someColor);
    someElement.textContent = someText;
    ...........

§
Postat în: 17-03-2015
Editat în: 17-03-2015
Also, I think there should be some default values, so that install codes without setting should works

here is a trick that I use in Stylish:

code:

/[[optionColor]]/ #00f /* /
settings:
blue (default)
#00f /
red
#f00 /* green
#0f0 /*
edit: i've learned how to put line numbers into the code block ;}

§
Postat în: 02-04-2015
Editat în: 02-04-2015

There are multiple libraries available for userscripts to implement options. Or one could write it's own settings dialog. This is not possible for UserStyles. So I understand the need for it on userstyles.org.

I don't really see the point for this for UserScripts. And with the already mentioned problems (updates, other repositories, source code, storing settings), this seems like more problems then solutions.

-1

Postează un raspuns

Autentifică-te pentru a posta un răspuns.