-
-
Notifications
You must be signed in to change notification settings - Fork 724
userscripts
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, first find the folder where your browsing data is stored. Depending on your operating system, it will be located in one of the following locations:
-
~/Library/Application Support/Min
on macOS -
%AppData%\Min
on Windows (which opensC:\Users\username\AppData\Roaming
) -
/home/username/.config/Min
on Linux.
Once you've opened that folder, create a new folder named userscripts
within it, and create a new file (called whatever you'd like) for your script. 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, check "Enable user scripts" under "Additional Settings" in Min's Preferences. (After you edit your script, you'll need to restart Min for your changes to take effect).
- Add vim-style keybindings: https://github.com/PalmerAL/min-vim-mode
- Automatically refresh a webpage: https://github.com/h0ek/Min-WebBrowser-Autorefresh
- Display any website using a dark theme: https://github.com/PalmerAL/min-dark-mode-userscript
- Show a tooltip when hovering over a link: https://github.com/PalmerAL/min-link-tooltip-userscript
- Block YouTube elements (like the Comments, Feed, etc.): https://github.com/Syndamia/min-youtube-element-blocker
- Get emojis with a right click: https://gist.github.com/manoger/fca7c36b0a87875a8377d37c3f4fe830
- Pretty Print raw JSON response: https://gist.github.com/CoderPrans/4fef0ec7fec3935533d4ce567d9a5819
- Custom CSS and Overlay Scrollbars scrollbars: https://github.com/ivancizik/min-css-scrollbar-userscript
- Redirect websites to their privacy-supporting mirrors (YouTube/invidio, Twitter/nitter, etc): min-browser-freestance
- Generate timestamped full page screenshot of a webpage: min-browser-full-screenshot
- Turn all web pages greyscale: https://gist.github.com/flber/a742a82ef0daba77c04b058bab1bb52f
- Easily post to the Pinboard bookmarking service: https://github.com/incanus/min-post-to-pinboard
- Mail current tab URL & title in your desktop mail client: https://github.com/incanus/min-mail-current-page
- A collection of userscripts: https://github.com/Sestowner/min-userscripts
- Translate selected text with DeepL: https://github.com/xpmn/min-userscripts/blob/main/To-DeepL.js
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!