Skip to main content
8 of 11
added 100 characters in body
Brock Adams
  • 13k
  • 5
  • 39
  • 64

You don't need to support alias domains. They redirect to *.stackexchange.com domains, anyway.

This will match all current Stack Exchange sites. It uses @match for smarter domain and path wildcards. @match also works better for Chrome:

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

Although, for slightly better speed and to help avoid unexpected results, you should also exclude some sites (Namely: The API, the main blogs1, SEDE, and the "all sites" pages) unless you are specifically coding for them. Their structure and purpose is markedly different.

So use:

// @match       *://*.askubuntu.com/*
// @match       *://*.mathoverflow.net/*
// @match       *://*.serverfault.com/*
// @match       *://*.stackapps.com/*
// @match       *://*.stackexchange.com/*
// @match       *://*.stackoverflow.com/*
// @match       *://*.superuser.com/*
// @exclude     *://api.stackexchange.com/*
// @exclude     *://blog.stackexchange.com/*
// @exclude     *://blog.stackoverflow.com/*
// @exclude     *://chat.stackexchange.com/*
// @exclude     *://chat.stackoverflow.com/*
// @exclude     *://data.stackexchange.com/*
// @exclude     *://elections.stackexchange.com/*
// @exclude     *://stackexchange.com/*

As a practical start for most scripts.


Note that onstartups no longer needs to be supported.

1 The "not so main" blogs are all/mostly on a separate domain: blogoverflow.com.

Brock Adams
  • 13k
  • 5
  • 39
  • 64