Skip to main content
fixed typo
Source Link
Nathan Osman
  • 23.3k
  • 11
  • 61
  • 107

template.user.js

// ==UserScript==
// @name Stack Exchange Userscript (Template)
// @grant none
// @match *://*.stackexchange.com/*
// @match *://*.stackoverflow.com/*
// @match *://*.superuser.com/*
// @match *://*.serverfault.com/*
// @match *://*.askububtuaskubuntu.com/*
// @match *://*.stackapps.com/*
// @match *://*.mathoverflow.net/*
// ==/UserScript==

var userscript = function($) {

// INSERT YOUR USERSCRIPT CODE HERE

};

var el = document.createElement('script');
el.type = 'text/javascript';
el.text = '(' + userscript + ')(jQuery);';
document.head.appendChild(el);

This template will

  1. Guarantee that your script can only run on Stack Exchange sites
  2. Run on all Stack Exchange sites (as of 7-10-2014, will be updated as necessary if new sites with unique URLs are added)
  3. Allow you to reliably use $ as jQuery within your userscript
  4. Be compatible with all major browsers (really not that fancy; should work virtually anywhere)

template.user.js

// ==UserScript==
// @name Stack Exchange Userscript (Template)
// @grant none
// @match *://*.stackexchange.com/*
// @match *://*.stackoverflow.com/*
// @match *://*.superuser.com/*
// @match *://*.serverfault.com/*
// @match *://*.askububtu.com/*
// @match *://*.stackapps.com/*
// @match *://*.mathoverflow.net/*
// ==/UserScript==

var userscript = function($) {

// INSERT YOUR USERSCRIPT CODE HERE

};

var el = document.createElement('script');
el.type = 'text/javascript';
el.text = '(' + userscript + ')(jQuery);';
document.head.appendChild(el);

This template will

  1. Guarantee that your script can only run on Stack Exchange sites
  2. Run on all Stack Exchange sites (as of 7-10-2014, will be updated as necessary if new sites with unique URLs are added)
  3. Allow you to reliably use $ as jQuery within your userscript
  4. Be compatible with all major browsers (really not that fancy; should work virtually anywhere)

template.user.js

// ==UserScript==
// @name Stack Exchange Userscript (Template)
// @grant none
// @match *://*.stackexchange.com/*
// @match *://*.stackoverflow.com/*
// @match *://*.superuser.com/*
// @match *://*.serverfault.com/*
// @match *://*.askubuntu.com/*
// @match *://*.stackapps.com/*
// @match *://*.mathoverflow.net/*
// ==/UserScript==

var userscript = function($) {

// INSERT YOUR USERSCRIPT CODE HERE

};

var el = document.createElement('script');
el.type = 'text/javascript';
el.text = '(' + userscript + ')(jQuery);';
document.head.appendChild(el);

This template will

  1. Guarantee that your script can only run on Stack Exchange sites
  2. Run on all Stack Exchange sites (as of 7-10-2014, will be updated as necessary if new sites with unique URLs are added)
  3. Allow you to reliably use $ as jQuery within your userscript
  4. Be compatible with all major browsers (really not that fancy; should work virtually anywhere)
deleted 219 characters in body
Source Link
Doorknob
  • 1.3k
  • 8
  • 19

template.user.js

// ==UserScript==
// @name Stack Exchange Userscript (Template)
// @grant none
// @match *://*.stackexchange.com/*
// @match *://stackoverflow.com/*
// @match *://*.stackoverflow.com/*
// @match *://superuser.com/*
// @match *://*.superuser.com/*
// @match *://serverfault.com/*
// @match *://*.serverfault.com/*
// @match *://askubuntu.com/*
// @match *://*.askububtu.com/*
// @match *://stackapps.com/*
// @match *://*.stackapps.com/*
// @match *://mathoverflow.net/*
// @match *://*.mathoverflow.net/*
// ==/UserScript==

var userscript = function($) {

// INSERT YOUR USERSCRIPT CODE HERE

};

var el = document.createElement('script');
el.type = 'text/javascript';
el.text = '(' + userscript + ')(jQuery);';
document.head.appendChild(el);

This template will

  1. Guarantee that your script can only run on Stack Exchange sites
  2. Run on all Stack Exchange sites (as of 7-10-2014, will be updated as necessary if new sites with unique URLs are added)
  3. Allow you to reliably use $ as jQuery within your userscript
  4. Be compatible with all major browsers (really not that fancy; should work virtually anywhere)

template.user.js

// ==UserScript==
// @name Stack Exchange Userscript (Template)
// @grant none
// @match *://*.stackexchange.com/*
// @match *://stackoverflow.com/*
// @match *://*.stackoverflow.com/*
// @match *://superuser.com/*
// @match *://*.superuser.com/*
// @match *://serverfault.com/*
// @match *://*.serverfault.com/*
// @match *://askubuntu.com/*
// @match *://*.askububtu.com/*
// @match *://stackapps.com/*
// @match *://*.stackapps.com/*
// @match *://mathoverflow.net/*
// @match *://*.mathoverflow.net/*
// ==/UserScript==

var userscript = function($) {

// INSERT YOUR USERSCRIPT CODE HERE

};

var el = document.createElement('script');
el.type = 'text/javascript';
el.text = '(' + userscript + ')(jQuery);';
document.head.appendChild(el);

This template will

  1. Guarantee that your script can only run on Stack Exchange sites
  2. Run on all Stack Exchange sites (as of 7-10-2014, will be updated as necessary if new sites with unique URLs are added)
  3. Allow you to reliably use $ as jQuery within your userscript
  4. Be compatible with all major browsers (really not that fancy; should work virtually anywhere)

template.user.js

// ==UserScript==
// @name Stack Exchange Userscript (Template)
// @grant none
// @match *://*.stackexchange.com/*
// @match *://*.stackoverflow.com/*
// @match *://*.superuser.com/*
// @match *://*.serverfault.com/*
// @match *://*.askububtu.com/*
// @match *://*.stackapps.com/*
// @match *://*.mathoverflow.net/*
// ==/UserScript==

var userscript = function($) {

// INSERT YOUR USERSCRIPT CODE HERE

};

var el = document.createElement('script');
el.type = 'text/javascript';
el.text = '(' + userscript + ')(jQuery);';
document.head.appendChild(el);

This template will

  1. Guarantee that your script can only run on Stack Exchange sites
  2. Run on all Stack Exchange sites (as of 7-10-2014, will be updated as necessary if new sites with unique URLs are added)
  3. Allow you to reliably use $ as jQuery within your userscript
  4. Be compatible with all major browsers (really not that fancy; should work virtually anywhere)
added 253 characters in body
Source Link
Doorknob
  • 1.3k
  • 8
  • 19

template.user.js

// ==UserScript==
// @name Stack Exchange Userscript (Template)
// @grant none
// @match *://*.stackexchange.com/*
// @match *://stackoverflow.com/*
// @match *://pt*.stackoverflow.com/*
// @match *://superuser.com/*
// @match *://*.superuser.com/*
// @match *://serverfault.com/*
// @match *://*.serverfault.com/*
// @match *://askubuntu.com/*
// @match *://*.askububtu.com/*
// @match *://stackapps.com/*
// @match *://*.stackapps.com/*
// @match *://mathoverflow.net/*
// @match *://*.mathoverflow.net/*
// ==/UserScript==

var userscript = function($) {

// INSERT YOUR USERSCRIPT CODE HERE

};

var el = document.createElement('script');
el.type = 'text/javascript';
el.text = '(' + userscript + ')(jQuery);';
document.head.appendChild(el);

This template will

  1. Guarantee that your script can only run on Stack Exchange sites
  2. Run on all Stack Exchange sites (as of 7-10-2014, will be updated as necessary if new sites with unique URLs are added)
  3. Allow you to reliably use $ as jQuery within your userscript
  4. Be compatible with all major browsers (really not that fancy; should work virtually anywhere)

template.user.js

// ==UserScript==
// @match *://*.stackexchange.com/*
// @match *://stackoverflow.com/*
// @match *://pt.stackoverflow.com/*
// @match *://superuser.com/*
// @match *://serverfault.com/*
// @match *://askubuntu.com/*
// @match *://stackapps.com/*
// @match *://mathoverflow.net/*
// ==/UserScript==

var userscript = function($) {

// INSERT YOUR USERSCRIPT CODE HERE

};

var el = document.createElement('script');
el.type = 'text/javascript';
el.text = '(' + userscript + ')(jQuery);';
document.head.appendChild(el);

This template will

  1. Guarantee that your script can only run on Stack Exchange sites
  2. Run on all Stack Exchange sites (as of 7-10-2014, will be updated as necessary if new sites with unique URLs are added)
  3. Allow you to reliably use $ as jQuery within your userscript
  4. Be compatible with all major browsers (really not that fancy; should work virtually anywhere)

template.user.js

// ==UserScript==
// @name Stack Exchange Userscript (Template)
// @grant none
// @match *://*.stackexchange.com/*
// @match *://stackoverflow.com/*
// @match *://*.stackoverflow.com/*
// @match *://superuser.com/*
// @match *://*.superuser.com/*
// @match *://serverfault.com/*
// @match *://*.serverfault.com/*
// @match *://askubuntu.com/*
// @match *://*.askububtu.com/*
// @match *://stackapps.com/*
// @match *://*.stackapps.com/*
// @match *://mathoverflow.net/*
// @match *://*.mathoverflow.net/*
// ==/UserScript==

var userscript = function($) {

// INSERT YOUR USERSCRIPT CODE HERE

};

var el = document.createElement('script');
el.type = 'text/javascript';
el.text = '(' + userscript + ')(jQuery);';
document.head.appendChild(el);

This template will

  1. Guarantee that your script can only run on Stack Exchange sites
  2. Run on all Stack Exchange sites (as of 7-10-2014, will be updated as necessary if new sites with unique URLs are added)
  3. Allow you to reliably use $ as jQuery within your userscript
  4. Be compatible with all major browsers (really not that fancy; should work virtually anywhere)
Source Link
Doorknob
  • 1.3k
  • 8
  • 19
Loading