Skip to content

Userscripts

Aditya Patil edited this page Feb 13, 2021 · 1 revision

User scripts allow you to modify webpages and add features to Kwick 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:

  • \users\username\appdata\roaming\min on Windows

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).

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