Creating user specific scripting

in Script development
Subscribe to Creating user specific scripting 7 posts, 3 voices



L4suicide User
FirefoxWindows

Hi,

I'd like to create a script that has certain features depending on the person who installs it. I was thinking of generating the script using php on a user by user basis so they can choose which features of the script they want to use.

However I am unable to get the .user.js file to start the install process for greasemonkey from my own domain - Is this something I should be able to do? My searches have only ever led me to rather naff 'install greasemonkey, then go to userscripts.org' "tutorials".

Is it possible to install greasemonkey scripts from other sites?

 
mike cupcake Scriptwright
FirefoxMacintosh

Yes, I installed this one just now:

http://steamgifts-giveaway-filter.googlecode.co...

What exactly happens when you click a link to a .user.js on your domain?

 
L4suicide User
FirefoxWindows

Well I have two scripts on there, one is a simple hello world, and the other is in a format that will later allow the customization. Both when clicked give nothing - but if it was a missing file the framework I used would say so. If I do ctrl+R it reverts to the last successful address. It's alsmost as if something is stopping me install the script (if it is there).

..after thought... I've just tried it on chrome and the links are giving different errors (from the framework) to firefox, so something in greasemonkey must be changing the default behaviour. So i'll try get the framework to play nicely first - at least I know now that I'm not wasting my time trying :) thanks

 
mike cupcake Scriptwright
FirefoxMacintosh

Does that link work for you?

Try testing in a fresh Firefox profile?

Maybe the MIME types are set wrong on your server or your framework is mangling the code somehow? Post a link to your helloworld if you'd like me to try it

 
Watilin Scriptwright
FirefoxWindows

From greasespot.net:

"Any file that ends in .user.js is a valid Greasemonkey user script.

When the URL of a link is clicked or otherwise navigated to ends with .user.js, Greasemonkey will intercept the loading file by presenting the installation dialog. Note that Greasemonkey must be enabled to intercept the loading of the file."

If you're getting errors with all of your browsers, the problem most likely resides on your server. As Mike Cupcake said, you should check your MIME headers. Be sure that it is text/javascript or application/javascript.

 
L4suicide User
FirefoxWindows

The culprit: <script type="text/javascript"> and </script>

My framework was doing one of those useful 'additions of info automatically' which causes the error.

It works in chrome with the above - which was confusing me, until I managed to find the script chrome had installed and realised the tags were added

Thanks everyone for your help!

 
mike cupcake Scriptwright
FirefoxMacintosh

Mangle mangle :-) Glad you've found the problem.