Why is the icon blue in Safari?
Safari automatically highlights most extension icons with a blue tint when the extension is active on the current web page. The StopTheMadness icon was originally designed to avoid this distracting blue tint, because StopTheMadness is active on every web page. However, Apple changed Safari in iOS and iPadOS version 15.1 so that StopTheMadness could no longer avoid the blue tint. You can read more about this change in my blog post.
You can selectively enable and disable StopTheMadness features. Your custom options can be configured to apply to every web page or just to web sites that you specify. To change the options, open the StopTheMadness popup. On iPhone, you can access StopTheMadness from the left menu in Safari's address bar.
On iPad, the StopTheMadness icon may appear directly in Safari's address bar.
www.google.com) and Google News (
news.google.com), because many people like to browse quickly through lists of images or articles. If you prefer to bypass both AMP links and the AMP viewer, switch from "links" to "links and viewer" in the popup menu.
news.google.com, etc. — and replaces the shortened URL with the unshortened destination URL. This occurs in a sandboxed process, without setting any cookies or other site data in Safari, so you can't be tracked by your click.
visibilitychangeevents, which are part of the Page Visibility API. Using this API, websites can learn when a tab is visible on your screen and when the tab is hidden. When Tab closing and visibility is enabled, websites can't observe when you show or hide a tab or your screen.
Navigator.sendBeacon) from firing.
utm_source(Urchin Tracking Module),
gclid(Google Click ID), and
fbclid(Facebook Click ID) from the end of the URL when you click, drag, or open a contextual menu on a link.
#:~:text=at the end of a link URL. When enabled, "Stop scroll to text fragment" removes the text fragment from the end of clicked links, so there's no text highlighting. This option is disabled by default.
New Tab Behavior:
(External links are cross-site, with a different domain than the current web site.)
target="_blank"to a link to make the link automatically open in a new tab when you click. If you prefer to open links in the current tab instead of a new tab, you can enable this feature, which removes
target="_blank"from links. When enabled, normal link clicks always open in the current tab. (You can still 2-finger click to open the link in a new tab.) When this feature is disabled, some links may automatically open in new tabs when clicked.
Dangerous Options (Site Breakage):
The features labeled "Dangerous Options" are intended to be used sparingly, only on specific sites where you know you need them, because otherwise they can cause a large number of incompatibilities on other sites.
textareaelements) are also protected by the website options "Protect ⌘-key shortcuts", "Protect copy, cut, and paste", and "Protect text selection". By default, only single-line editors (HTML
inputelements) are protected, because multi-line editors don't usually prevent copy and paste, and a lot of websites have special multi-line "rich text" editors with highly customized editing that can break with the textarea feature enabled. However, you may need to enable this feature on certain websites if they disable copy and paste.
window.open()API to open a new window or tab. This API is sometimes used for annoyances such as sending you to an advertiser's site.
Keyboard-related (These options are hidden on iPhone):
The features labeled "Keyboard-related" are intended to be used only on an iPad with an external hardware keyboard attached.
When you change the website options in StopTheMadness, those changes apply immediately to the active Safari tab, and will apply to all web pages loaded thereafter in any tab. If you already had a web page open in a background tab before you changed the website options, and you want the changes to apply immediately to that web page, you need to switch to the tab and reload the page.
How to Add Website Options:
The Default options for all websites apply to every web page in Safari, unless you have custom options for a particular site. To create custom options for a website, type the website into the URL-specific options field and then press the New button to disable all of the new options or the Duplicate button to duplicate all of the options from the currently selected website. (The Done button closes the keyboard without adding anything.) The New button is useful if you're experiencing a website compatibility issue with StopTheMadness and just want to disable everything.
There are two ways to specify websites: domain or URL. Examples of domains are "
apple.com" and "
google.com". If you specify a domain, then subdomains of that domain are automatically covered too. For example, "
google.com" also covers "
mail.google.com", etc. If you want a subdomain to have different options than its domain, create a separate item for the subdomain. The longest match always wins, so if you have items for both "
google.com" and "
mail.google.com", then your "
mail.google.com" options will apply when you load the page "
https://mail.google.com/". If you want options to apply only to subdomains but not to the domain, put a dot at the beginning: "
.google.com" applies to "
https://www.google.com/", etc., but not to "
You may want to apply custom options only to certain paths of a website, in which case you need to specify the website as a full URL. For example, if you enter "
https://www.google.com/maps", then the custom options will only apply to Google Maps and not to Google Search at "
https://www.google.com/". Subpaths are automatically covered too: "
https://www.google.com/maps" would also cover "
https://www.google.com/maps/search". You can customize subpath options by creating a separate item for the subpath. As with domains, the longest match among URLs always wins. And a URL setting that includes a domain will override a domain setting for the same domain, since the URL is longer. So "
https://www.google.com/maps" takes precedence over "
When you press the Video Highlight button, everything on the current web page becomes hidden except videos. (If there are no videos, the page will be blank.) Pressing the button again toggles page visibility back on. Video Highlight is temporary and gets reset when you navigate to a new page in the current tab.
Video Highlight is great for accessing all of the native video controls. The website option "Show video controls" works on the majority of videos, but there are some exceptions, and in those cases Video Highlight should work. Or if you prefer, you can use Video Highlight instead of "Show video controls".
When the "Hover shortcuts" website option is enabled, the keyboard shortcut option-command-v triggers the video highlight feature.
Edit Tab URL:
When you press the Edit Tab URL button, the URL in the Safari address bar is opened in a separate editor window, which makes it much easier to edit the URL.
Delete URL Query deletes any query (for example,
?utm_source=) from the end of the URL. Copy URL copies the URL to the system clipboard and closes the editor window. Open URL opens the web page of the URL.
<style> element and Custom
If you enter text into this area, StopTheMadness will create a custom HTML
<style> element" or "Custom
<script> element" area; this makes it easy to import files from userscript sites such as Greasy Fork.
You can enable "Also use Default options" to make the selected website inherit any custom CSS or JS that you've defined in the Default options. This allows you to use your custom CSS or JS on every website, including websites with customized options.
Technical notes: Custom elements are loaded into all frames on the web page. The custom
<script> element is created after the
DOMContentLoaded event, and you can check
You can replace one font with a different font on websites by creating a font replacement rule. The replacement can be either a system font from your Mac or a web font from a URL. The font URL can be absolute (
https://) or a path relative to the URL of the website. To use one of Apple's San Francisco fonts, select it under the System category in the Replacement Font popup.
One limitation is that Safari refuses to display user-installed local fonts. The only local replacement fonts allowed are system fonts. This limitation is caused by tracking prevention in WebKit. Unfortunately there's no known workaround for this limitation.
When you create a font replacement rule, StopTheMadness automatically adds the appropriate @font-face CSS rules to the page. To replace a generic font-family name, select Serif, Sans-serif, or Monospace under the Generic category in the Original Font popup. To replace the default Safari font, use Times for the Original Font Name, because Safari uses Times when no font is specified by the page.
Use the Style popup if you need fine-grained control over font replacement for particular styles such as bold or italic.
You can enable "Also use Default options" to make the selected website inherit any font replacement rules that you've defined in the Default options. This allows you to use your font replacement rules on every website, including websites with customized options.
Use my Safari content blocker StopTheFonts to block web fonts entirely. When web fonts are blocked, Safari falls back to system fonts, and your replacements rules in StopTheMadness will apply in that case.
StopTheMadness can automatically redirect URLs so that when you open a link to one web site, your web browser loads a different site of your choosing. For example, you can redirect new Reddit to old Reddit if you prefer the old user interface. Or you can use privacy-preserving alternatives to popular web sites such as Nitter for Twitter and Invidious for YouTube. You can even redirect URLs to open in native iOS apps, using a custom URL scheme.
String.replace() to redirect URLs. To create a redirect, you need a URL matching pattern and a replacement for that pattern. The matching pattern can be either a substring of the URL or a regex expression enclosed in "/" characters. The replacement is always a substring, though there are some special characters you can use in the replacement, as explained by the
String.replace() documentation. Examples:
URL matching pattern:
https://old.reddit.com/URL matching pattern:
https://nitter.net/URL matching pattern:
$1?useskin=vector$2URL matching pattern:
?view=cm&fs=1&to=URL matching pattern:
The redirect rules are matched in the order they appear in StopTheMadness, though the order usually shouldn't matter if the rules are for different domains. If needed, you can use the up arrow buttons to change the order. You can also use the checkboxes to temporarily disable a rule.
Here are some examples of redirecting URLs to a native iOS app, using a custom URL scheme.
URL matching pattern:
reddit://URL matching pattern:
youtube://URL matching pattern:
There are many other URL schemes that you can use, such as
Migrate Safari Extension Settings to a New Device:
StopTheMadness for both iOS and macOS supports export and import of your custom Safari extension settings with iCloud.
Temporarily disable the extension:
If you need to quickly disable the Safari extension temporarily, just uncheck "Extension enabled" at the top of the popup. The toolbar icon will be badged with "OFF". The extension remains disabled until you check "Extension enabled" again.
Known Website Compatibility Issues:
In these cases you may want to create custom website options and disable the specific feature.
Mastodon: (1) Show video controls requires Include loops. (2) Stop link trackers opens images in new tabs instead of in the image carousel popup.
Show video controls:
Stop autoplaying videos:
Protect copy, cut, and paste: