Home : Support

StopTheMadness for macOS Safari Support

Help Topics:

Safari Technology Preview:
StopTheMadness is fully compatible with Safari Technology Preview. However, enabling StopTheMadness in Safari does not automatically enable it in Safari Technology Preview, so you'll need to enable StopTheMadness in Safari Technology Preview's Preferences.

According to Safari's Preferences, StopTheMadness "Can read sensitive information from webpages, including passwords, phone numbers, and credit cards on all webpages" and "Can see when you visit all webpages". However, this is just boilerplate text from Apple shown for every Safari extension that can modify webpages. StopTheMadness does not read, use, or share your personal data. The privacy policy has more details about StopTheMadness privacy. See also my blog post The security of Safari extensions for a more detailed explanation of StopTheMadness permissions.

Why is the icon tinted in Safari?
Safari automatically tints most extension icons when the extension is active on the current web page. The tint is your accent color from General System Preferences. The StopTheMadness icon was originally designed to avoid this distracting tint, because StopTheMadness is active on every web page. However, Apple changed Safari version 15.1 so that StopTheMadness could no longer avoid the tint. You can read more about this change in my blog post.

Website Options:
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 in the toolbar of a Safari window, and select the Website Options tab.

StopTheMadness Website Options Tab

There are a number of protection features that you can enable and disable. By default, the "Recommended" features are enabled. These provide you with a high level of protection while also maximizing website compatibility. The features labeled "Use with caution" provide even higher levels of protection, but there may be more sites that don't work right when they're enabled, which is why they're disabled by default. The features labeled "Widespread breakage" 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. Any and all of the features can be enabled or disabled as necessary or desired. Below is an explanation of each feature.


Use with caution:

Widespread breakage:

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, press the + button. 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 "www.google.com", "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 "https://google.com/".

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/apple+park". 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 "www.google.com".

Custom <style> element and Custom <script> element:
If you enter text into this area, StopTheMadness will create a custom HTML <style> or <script> element on the web page. The text you enter will become the element's inline CSS or JavaScript. If the text area is empty, then no custom element is created on the web page. StopTheMadness doesn't check your syntax, so you'll probably want to copy the CSS and JS from elsewhere and paste it into StopTheMadness, for example from userscript sites such as Greasy Fork. (The custom <script> element is created after the DOMContentLoaded event.)

The custom CSS or JS that you enter in the Custom Elements tab applies to the current selection in the Website Options tab. Custom Elements are in a separate tab in order to provide enough space for text entry.

You can enable "Also use Default options for all websites" 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.
StopTheMadness Custom Elements Tab

Safari style sheet customization: This is a legacy feature, superseded by Custom CSS, but the feature is still available for use if desired. When enabled, StopTheMadness adds the attribute stopthemadness-href with the value of the URL of the page to the html element of the page. You can use this attribute to write site-specific CSS in your Safari style sheet. You can set your .css file as the style sheet in the Advanced tab of the Preferences window in Safari. (Note: If you edit your style sheet while Safari is open, you'll need to relaunch Safari for the changes to take effect.)
For more details, along with useful examples of site-specific CSS, see StopTheMadness for Safari Style sheet.

Font Replacements:
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.

StopTheMadness Fonts Tab

You can enable "Also use Default options for all websites" 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.

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.

StopTheMadness Redirects Tab

StopTheMadness uses the JavaScript function 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 Replacement
https://www.reddit.com/ https://old.reddit.com/
https://twitter.com/ https://nitter.net/
/^https://en\.wikipedia\.org/[^?]+$/ $&?useskin=vector
/^mailto:/ https://mail.google.com/mail/?view=cm&fs=1&to=
/^http:/ https:

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 drag and drop to change the order. You can also use the checkboxes to temporarily disable a rule.

The Redirects are checked by StopTheMadness before the Web URL Rules, so the two features can be combined to redirect a URL and then open the redirected URL in another app.

Contextual Menu:
By default, StopTheMadness stops web sites from disabling Safari's contextual menu. This is the "Protect contextual menus" website option. YouTube and Google Maps are examples of sites that disable Safari's contextual menu. If you still need to open a web site's custom contextual menu instead of Safari's contextual menu, just press the option key while you open the menu.

StopTheMadness may inadvertently prevent other Safari extensions from adding custom menu items to Safari's contextual menu. The option key also helps with this. Alternatively, you can enable "Protect contextual menus only when option key is pressed" in the Contextual Menu tab of the StopTheMadness popup. Enabling this reverses the behavior of the "Protect contextual menus" website option: if you press the option key when opening a contextual menu in Safari, then StopTheMadness will protect the menu from modification, but otherwise web sites and other Safari extensions can modify the contextual menu.

StopTheMadness inserts a "Copy Link Title" item into Safari's contextual menu. This menu item copies the visible title of a link. (In contrast, the built-in "Copy Link" menu item copies the URL of a link.) If you don't want this item to appear in Safari's contextual menu, open the StopTheMadness popup in the toolbar of a Safari window, select the "Contextual Menu Items" tab, and uncheck "Copy Link Title".

Optionally, you can add an item to Safari's contextual menu to open links in an alternative browser:

Safari contextual menu

To enable this menu item, select a browser from the "Open Link with" popup menu. To disable the menu item, select the top empty row in the same popup menu.

StopTheMadness Contextual Menu Items Tab

If you have Link Unshortener installed, you can set it as the alternative browser. StopTheMadness and Link Unshortener were designed to work together.

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.

Extension disabled

Known Website Compatibility Issues:
In these cases you may want to create custom website options and disable the specific feature.

Home : Support