Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
Last active August 21, 2022 18:32
Show Gist options
  • Save sindresorhus/1639564 to your computer and use it in GitHub Desktop.
Save sindresorhus/1639564 to your computer and use it in GitHub Desktop.
Userscript template
// ==UserScript==
// @name Script name
// @description Description
// @namespace https://yourwebsite.com
// @version 0.1.0
// @author Your name
// @license MIT
// @released 2016-10-18
// @updated 2016-10-18
// @match *://example.com/*
// @match *://www.example.com/*
// @run-at document-start
// ==/UserScript==
(() => {
'use strict';
// before the DOM has loaded
document.addEventListener('DOMContentLoaded', e => {
// after the DOM has loaded
// silently fails in Firefox if placed outside when `document-start`
GM_addStyle('body { background: hotPink }');
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment