Useful tricks for Firefox

Some settings for Firefox cannot be adjusted in the normal way (via the “Settings” menu item).

Remove service workers

  • Open about:debugging#/runtime/this-firefox in the address bar.
  • Delete all listed service workers by entering
    for (let button of document.querySelectorAll(".qa-unregister-button")) { button.click(); }
    in the debugger console.

More than 4 rows of top sites on start page

  • Open about:config in the address bar.
  • Enter browser.newtabpage.activity-stream.topSitesRows in the search field.
  • Enter the desired number of rows.

Keep backspace key from going back to previous page

  • Open about:config in the address bar.
  • Enter browser.backspace_action in the search field.
  • Set the value to 2 to unmap the backspace key.

Customise/hide elements on websites

  • In the address bar, enter about:config.
  • In the search field, enter toolkit.legacyUserProfileCustomizations.stylesheets.
  • Set the value to true to enable custom stylesheets
  • Open the user folder:
    Linux: /home/[username]/.mozilla/firefox /[profile-id].default-release/
    macOS: /Users/[username]/Library/Application Support/Firefox/Profiles/[profile-id].default-release/
  • Create a subfolder called ‘chrome’ there (if it does not already exist) and create a file called ‘userContent.css’ within it.
  • In this file, define styles for elements on specified domains, e.g.
    @-moz-document domain(www.ex-parrot.de) {
    .sample-class {
    display: none !important;
    }
    #sample-id {
    font-weight: bold !important;
    }
    }
  • Activate new/modified styles by restarting Firefox.

Add custom search engines (no OpenSearch Support)

  • Open about:config in the address bar.
  • Enter browser.urlbar.update2.engineAliasRefresh in the search field and set it to true.
  • Go to “Settings” → “Search.”
  • In the “Search Shortcuts” section, you should now see an “Add” button.
  • Click “Add” and fill in:
    • Name (e.g., “Custom Search”)
    • Search URL (replace the search term with %s, e.g., https://www.example.com/search?q=%s)
    • Optional keyword for quick access
  • Save your new search engine.