Обсуждения » Обсуждение сайта Greasy Fork
Custom script variables on the Install page
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.
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; ...........
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)edit: i've learned how to put line numbers into the code block ;}
#00f / red
#f00 /* green
#0f0 /*
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
Custom script variables on the Install page
It'd be nice to have custom variables on the Install page like on userstyles.org:
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.