Creating Installation Links for Your Tampermonkey Extensions

Creating Installation Links for Your Tampermonkey Extensions

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.


The Problem

When you create a Tampermonkey userscript, you typically need to:

  1. Share the script file
  2. Ask users to manually open Tampermonkey
  3. Create a new script
  4. Copy and paste your code

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.


How It Works

Example 1: GitHub Raw File

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

Example 2: Local Development

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

Example 3: Any Web Server

Any publicly accessible URL works:

https://www.tampermonkey.net/script_installation.php#url=https://example.com/scripts/my-userscript.user.js

Step-by-Step Guide

  1. Host your userscript somewhere accessible via URL (GitHub, your website, Gist, etc.)
  2. Get the direct link to the raw script file (must end in .user.js)
  3. Create the installation link using the format:
    https://www.tampermonkey.net/script_installation.php#url=YOUR_SCRIPT_URL
    
  4. Share the link with your users

When users click the link, Tampermonkey will:

  • Detect the script
  • Show the installation dialog
  • Allow them to install with one click

Best Practices

1. Use Proper File Extension

Your script file should end with .user.js so Tampermonkey recognizes it as a userscript.

2. Include Metadata

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==

3. Version Control

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

Real-World Example: Hotelier Tools

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!


Try It Yourself!

Want to see this in action? You can test the installation link with my real userscript:

📥 Install Example Script

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?


Additional Tips

For better readability, use a URL shortener:

https://bit.ly/my-userscript

Add an Installation Badge

Make it visual in your README:

[![Install with Tampermonkey](https://img.shields.io/badge/Install%20with-Tampermonkey-00485B?style=for-the-badge&logo=tampermonkey&logoColor=white)](https://www.tampermonkey.net/script_installation.php#url=YOUR_SCRIPT_URL)

Troubleshooting

  • Ensure the script URL is publicly accessible
  • Check that the file ends with .user.js
  • Verify the URL is properly encoded (no special characters)

Script Doesn't Install

  • Check that Tampermonkey is installed in the browser
  • Ensure the script has proper metadata headers
  • Verify the @match or @include patterns are correct

Conclusion

Creating 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!


Credit

Thanks to the Stacks project for this useful tip!


Additional Resources

2025-11-22 20:002025-11-22T20:00:00.000ZTampermonkeyUserScriptJavaScriptBrowser ExtensionAutomationTips

Copyright © 2025. All rights reserved.

Made with ❤️ by Juanman Béc