I need to host a userscript on an internal company website. How do I build the href
so that Greasemonkey will install the userscript when the link is clicked?
I tried a simple <a href="user.js">Install Userscript</a>
but Chrome and Firefox simply show the file source instead of installing the userscript.
Your link should look like:
<a href="https://example.com/your_script.user.js">Click to install script X</a>
<small>(A userscript engine, like Tampermonkey, is required.)</small>
In order for your install link to work, the following conditions must be met:
.user.js
. Example: stack_exchange_edit_reasoner.user.js
text/html
content type. (You would have to tamper with your server's default settings for this to be an issue.)Also, if you wish for automatic updates to work, the script should be served via an https
link (or it gets complicated).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With