Have you ever created a Tampermonkey userscript and wanted to share it with others in the easiest way possible? In this quick tip, I'll show you how to create direct installation links that allow users to install your extension with just one click.
When you create a Tampermonkey userscript, you typically need to:
This process is cumbersome and can discourage users from trying your script.
Tampermonkey provides a simple URL scheme that allows users to install scripts directly from a link:
https://www.tampermonkey.net/script_installation.php#url=[YOUR_SCRIPT_URL]
Simply replace [YOUR_SCRIPT_URL] with the URL where your userscript is hosted.
If you host your script on GitHub, you can use the raw file URL:
https://www.tampermonkey.net/script_installation.php#url=https://raw.githubusercontent.com/username/repo/main/script.user.js
This even works with local projects! If you're running a local development server:
https://www.tampermonkey.net/script_installation.php#url=http://localhost:3000/my-script.user.js
Any publicly accessible URL works:
https://www.tampermonkey.net/script_installation.php#url=https://example.com/scripts/my-userscript.user.js
.user.js)https://www.tampermonkey.net/script_installation.php#url=YOUR_SCRIPT_URL
When users click the link, Tampermonkey will:
Your script file should end with .user.js so Tampermonkey recognizes it as a userscript.
Make sure your script includes proper metadata headers:
// ==UserScript==
// @name My Awesome Script
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Does something cool
// @author Your Name
// @match https://example.com/*
// @grant none
// ==/UserScript==
Keep your script versioned so users can update when you release new versions:
// @version 1.0.1
// @updateURL https://raw.githubusercontent.com/username/repo/main/script.user.js
// @downloadURL https://raw.githubusercontent.com/username/repo/main/script.user.js
I use this technique in my own project Hotelier Tools, where I created a Tampermonkey extension to add a "Check Front Desk" button for Little Hotelier.
The script is hosted on GitHub at:
https://github.com/JuanmanDev/TampermonkeyLittleHotelier/blob/main/directBooking/addButtonCheckOnFrontDesk.user.js
The raw URL is:
https://github.com/JuanmanDev/TampermonkeyLittleHotelier/raw/main/directBooking/addButtonCheckOnFrontDesk.user.js
The installation link becomes:
https://www.tampermonkey.net/script_installation.php#url=https://github.com/JuanmanDev/TampermonkeyLittleHotelier/raw/main/directBooking/addButtonCheckOnFrontDesk.user.js
This makes it incredibly easy for users to install the extension with just one click!
Want to see this in action? You can test the installation link with my real userscript:
Note: You need to have Tampermonkey installed in your browser for this link to work.
When you click the link, Tampermonkey will open and show you the installation dialog. Pretty cool, right?
For better readability, use a URL shortener:
https://bit.ly/my-userscript
Make it visual in your README:
[](https://www.tampermonkey.net/script_installation.php#url=YOUR_SCRIPT_URL)
.user.js@match or @include patterns are correctCreating installation links for your Tampermonkey extensions makes them much more accessible to users. This simple trick removes friction from the installation process and encourages more people to try your scripts.
Give it a try with your next userscript project!
Thanks to the Stacks project for this useful tip!