Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 1.07 KB

File metadata and controls

19 lines (13 loc) · 1.07 KB

Userscript template

This is the general structure I use when making userscripts, to avoid much of the usual pain involved.

Getting Started

  • click "use this template" on the top right to make a new repo
  • clone it locally with git clone
  • pnpm install (if you don't have pnpm already, install it)

For development - run pnpm dev, and copy the userscript given to your favorite userscript manager (I recommend violentmonkey). You may need to accept a permission popup that asks to "Look for and connect to any device on your local network", when on the page you want to use your userscript with.

This example shows an image in the browser's console when visiting https://example.com.

Customizing

  • IMPORTANT: replace the value of @match in src/banner.ts with the site your userscript is for
    • recopy the development userscript after changing this!
  • replace values like name, author etc in package.json with your own

To make a release usable by other people, run pnpm build, then check the dist folder.