cross-posted from: https://lemmy.ml/post/282143

It is a better practice to make your own browser setups rather than following someone else’s setup blindly IMO. There are several guides for Firefox that just suggest prefs they copy-paste from arkenfox’s user.js. As for Chromium based browsers, you will only rarely find some actually good recommendations. This guide will first take you through how you can make your privacy and security friendly setup for Firefox and then, recommendations for Chromium browsers (+my personal browser extension recommendations). The reason why I am writing this is that there’s just a lot of crap on the internet and I have wasted time with many of them when I was still new to all of this. So without further ado, let’s start…

For Firefox:

  1. You should create a new profile in which you can comfortably use a custom user.js. Do NOT modify default profiles, keep them as backups.
  2. Firstly, try arkenfox’s user.js without any modifications and see if you are comfortable with it, if not you should identify what’s making you uncomfortable with it and note down your problems somewhere (believe me, it makes the next step much faster). e.g.: some of you can have problmes with user_pref("media.eme.enabled", false); which disables DRM and can break sites like Spotify, Netflix etc.
  3. Read arkenfox’s user.js, every word, it took me >2hrs and it was one of my best investments in 2020. The maintainers have explained almost everything in the comments, if you can’t understand something, just look it up on the internet or open a GitHub issue in arkenfox/user.js repository.
  4. Create a seperate user-overrides.js in the same directory and make your own changes, firstly fixing your problems you identied in the 2nd step. e.g.: adding user_pref("media.eme.enabled", true); to the user-overrides.js to enable DRM
  5. Once you are done doing this, append the contents of user-overrides.js to the arkenfox’s user.js (this is the simplest way to use arkenfox’s user.js with your own modifications)

You should definitely read https://github.com/arkenfox/user.js/wiki/3.1-Overrides and in fact, all the 3.x wiki pages. Here’s my own, updated, user-overrides.js(consider uploading it somewhere if you find it useful so that if anyone wants to use it after June 3, 2022, they can find it in the comments) for example. You can also use it for yourself if you wish, of course after reading it properly. It is a convenient setup IMO with optional hardening and some extra spice from Kellegram’s user.js(special thanks to him).
You might ask why did I suggest making a user-overrides.js instead of directly editing the user.js, I suggested so because Mozilla adds/removes/modifies prefs with updates and thus a new updated version of arkenfox’s user.js is also released every month after Firefox stable update. Using the user-overrides.js method, as suggested by arkenfox themselves, is a better idea. You can even use scripts provided by arkenfox if you follow this method.
Here are some general recommendations for Firefox users: make sure you put the firefox profile in an encrypted partiton, I am using Full disk encryption on my openSUSE Tumbleweed install, on windows you can use Bitlocker to encrypt a partition in which you will put your firefox profile. You should use the official flatpak on Linux for the sake of sandboxing and more control over the permissions. Consider NOT to use forks like Librewolf and such, I have usually observed them to be lagging behind the official stable releases of Firefox(I am hoping that they don’t lag behind too much anymore). On Android, use Firefox Nightly or the forks like Fennec F-droid if you want to modify about:config.

For Chromium-based Browsers: Even though you don’t have as much control over the configurations as you do in Firefox, you can still improve a few things in Chromium-based browsers.

  1. From the Settings, disable any type of telemetry.
  2. From the Settings, enable safe browsing, block 3rd party cookies, enable ‘Clear cookies and site data when you close all windows’(just whitelist the site you want to stay logged in in by adding them to ‘Sites that can always use cookies’), enable ‘Always use Secure connections’ and enable ‘Use Secure DNS’(and use DoH of your own choice)
  3. Goto chrome://flags and do the following:
    • Set ‘SetIpv6ProbeFalse’ to ‘Enabled’
    • Set ‘Handling of extension MIME type requests’ to ‘Always prompt for install’
    • Set ‘Force punycode hostnames’ to ‘Enabled’
    • Set ‘Enable get*ClientRects() fingerprint deception’ to ‘Enabled’
    • Set ‘Enable Canvas::measureText() fingerprint deception’ to ‘Enabled’
    • Set ‘Enable Canvas image data fingerprint deception’ to ‘Enabled’
    • Set ‘Block insecure private network requests.’ to ‘Enabled’
    • Set ‘Parallel downloading’ to ‘Enabled’
    • Set ‘Strict-Origin-Isolation’ to ‘Enabled’
    • Set ‘Strict site isolation’ to ‘Enabled’
    • Set ‘Site isolation for Password sites’ to ‘Enabled’
    • Set ‘Reduce User-agent request header’ to ‘Enabled’
    • Set ‘Reduce the minor version in the User-agent string’ to ‘Enabled’
    • Set ‘Sanitizer API’ to ‘Enabled’

Chromium based browsers provide descriptions with these flags so make sure you read them. Also, note that you won’t find some of these flags in some Chromium based browsers, you can skip them in that case.
Here are some general recommendations: do NOT use Microsoft Edge(although Edge has some extra flags for security), Google Chrome, Opera and such, instead use Ungoogled Chromium, Brave Browser or even just vanilla Chromium. If you are on Linux, use Flatpaks for the sake of sandboxing and more control over permissions. On Android, use Bromite.

Extensions I recommend(read their descriptions on AMO and Chrome Webstore):

Do NOT expect any revisions from my side as I will be deleting this account soon. I am hoping that the community will revise this guide from time to time in their own ways. I know that this is very time consuming but it is definitely worth it, this way you become self-reliant in your pursuit towards a more private and secure internet usage that is for you. Thank you for reading this guide, I hope this helps.

  • KaishinButaku@lemmy.mlOP
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    4 years ago

    I have added comments in my user-overrides.js exactly for that purpose but I can still give an overview.

    • I have enabled some of the pages disabled by default in arkenfox’s user.js like the home page, set new tab page to use home page instead of throwing a completely empty tab and such.
    • I have enabled search engine updates, defaulted the download directory to OS’s default download directory (for e.g. ~/Downloads in most Linux distros), enabled the search on location bar, enabled find as you type functionality, enabled search engine suggestions, make the chrome(like the home page and such, it doesn’t affect the sites because of resistFingerprinting) use dark mode by default and more.
    • I am forcing AdGuard DoH with fallback to system DNS disabled, you can use any other DoH of your preference by just replacing the URLs in line 14 and 15 of my overrides.
    • DRM is enabled for the sake of sites used by many people, like Spotify, Netflix
    • There’s a pref in arkenfox’s user.js that breaks some video streaming sites, network.http.referer.XOriginPolicy, which I have set to 0, i.e. the default in firefox, and would recommend using Smart Referrer extension with strict mode and whitelists disabled instead because the extension can be toggled off on the go if some site breaks because of it.
    • enabled developer tools inside browser context.
    • disabled resistFingerprinting’s letterboxing.
    • Done some optional hardening which includes disabling ETP web compat(can break sites like Facebook), JIT(don’t worry, extensions can still use JIT because of a certain pref), ION, webassembly and asm.js. all of these except etp web compat, mostly only impact the performance of JS on sites, and I have hardly noticed any performance drops. I had to do it because of the security issues related to these JS performance improvement technologies. Arkenfox’s user.js’s comments have included links for more information about security issues related to these.
    • added quality of life additions from Kellegram’s user.js, which includes changes that should make the scrolling experience much better than compared to the default and a few more stuff.
    • there’s more small stuff which you can read about from arkenfox’s user.js’s comments and my own comments.

    As you can tell, most of my changes are related to convenience, looks, optional hardening, forcing a few prefs and such. You should definitely give it a read after arkenfox’s user.js. I apologise for the late reply.

    • ganymede@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      4 years ago

      Wow, great job. Very much like your work and your guide.

      Quick note, what do you mean by?

      enabled search engine suggestions

      I tried to check with your user-overrides.js but the file is gone?

      • KaishinButaku@lemmy.mlOP
        link
        fedilink
        arrow-up
        1
        ·
        4 years ago

        By default, arkenfox’s user.js disables the suggestions you get while searching using the search bar on home page and location bar. I have re-enabled it.
        file.io only provides temporary storage, but I didn’t expect it to delete my file before the said date. I have uploaded it on wetransfer this time, here you go: https://we.tl/t-3rn02cSnBA

        • ganymede@lemmy.ml
          link
          fedilink
          arrow-up
          0
          ·
          4 years ago

          Cool, thanks for the new details.

          Just my 2c, be wary of search bar suggestions if it may leak data to 3rd party, including accidental typings etc, timing info etc

          • KaishinButaku@lemmy.mlOP
            link
            fedilink
            arrow-up
            1
            ·
            4 years ago

            Right, which is why you should use a privacy respecting search engine. Can’t ditch Google? Use a metasearch engine like SearXNG. Some of SearXNG’s instances have no issues with Google searches, like https://paulgo.io/ which I have been using for sometime now.

            • ganymede@lemmy.ml
              link
              fedilink
              arrow-up
              0
              ·
              edit-2
              4 years ago

              that is a good point, and thanks for the recommendation.

              though its also good to be mindful of privacy respecting re. search terms vs privacy respecting re. data leaks. and some timing leaks are independent of the plaintext payload, ie. easily grabbed in transit.