Skip to content
alyssadev edited this page Aug 10, 2024 · 35 revisions

User scripts allow you to modify webpages and add features to Min by creating snippets of JavaScript that will run after a page loads or that can be run on command.

To create a userscript, go to Min's Preferences, check "Enable User Scripts", then click "Show script directory". Depending on your operating system, this will open one of the following folders:

  • ~/Library/Application Support/Min/userscripts on macOS
  • %AppData%\Min\Userscripts on Windows (which opens C:\Users\username\AppData\Roaming)
  • /home/username/.config/Min/userscripts on Linux.

Next, create a new file inside this folder for your script, called whatever you'd like. At the top of your file, you'll need to add a header specifying when and where your script should run. The basic header template looks like this:

// ==UserScript==
// @name Example Script
// @match *
// @exclude example.com
// @run-at document-start
// ==/UserScript==

You can include as many match or exclude rules as you want, and your script will run on every page that matches and isn't excluded. These rules also support wildcards, such as *.google.com.

If you want to choose when to run your script instead, you can specify @run-at context-menu, and an item will be added to the context menu to run your script. Scripts can also be run from the searchbar by typing !run and then searching for the name of your script.

Scripts must be saved as a .js file (for example, my-script.js). If you are on Windows, make sure to turn on file name extensions to see the full file name.

Once you've saved your script, the updated script will run the next time you reload a tab or navigate to a new page.

Examples

This article is editable as long as you have a GitHub account - if you have an example of a script that you've made, please upload it to GitHub Gist, and add it here!

Clone this wiki locally