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:
- The filename must end in
.user.js
. Example: stack_exchange_edit_reasoner.user.js
- The browser must be running a compatible userscript extension. For example, Tampermonkey or Greasemonkey.
- The file must NOT be served with
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).