summaryrefslogtreecommitdiff
path: root/modules/home-manager/personal/programs/firefox/userjs.nix
blob: d95347dc3e5a14746f52b6026f292d7052ea7e1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
  arkenfox,
  toUserJS,
}: let
  self = {
    arkenfox = builtins.readFile "${arkenfox}";
    default =
      self.arkenfox
      + toUserJS {
        "signon.rememberSignons" = false; # 0901
        "security.nocertdb" = true; # 1222
        "media.peerconnection.enabled" = false; # 2001
        "media.peerconnection.ice.no_host" = true; # 2004
        "dom.allow_cut_copy" = true; # 2404
        "dom.battery.enabled" = false; # 2502
        "permissions.default.xr" = 2; # 2521
        "privacy.clearOnShutdown.siteSettings" = true; # 2811
        "browser.search.separatePrivateDefault" = false; #0830
        "browser.search.separatePrivateDefault.ui.enabled" = false; #0830

        # Personal
        ## Warnings
        "browser.tabs.warnOnClose" = false;
        "browser.tabs.warnOnCloseOtherTabs" = false;
        ## Updates
        "app.update.auto" = false;
        "browser.search.update" = false;
        ## Appearance
        "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
        ## Content behavior
        "clipboard.autocopy" = false;
        ## UX behavior
        "browser.quitShortcut.disabled" = true;
        "browser.tabs.closeWindowWithLastTab" = false;
        ## UX features
        "extensions.pocket.enabled" = false;
        "identity.fxaccounts.enabled" = false;
      };

    streaming =
      self.default
      + toUserJS {
        # Cache
        "browser.cache.disk.enable" = true;
        "browser.cache.offline.storage" = true;
        # Privacy
        "privacy.clearOnShutdown.cache" = false;
        "privacy.clearOnShutdown.cookies" = false;
        "privacy.clearOnShutdown.siteSettings" = false;
        "privacy.clearOnShutdown.offlineApps" = false;
      };

    videoconferencing =
      self.default
      + toUserJS {
        # IMPORTANT: uncheck "Prevent WebRTC from leaking local IP addresses" in uBlock Origin's settings
        # NOTE: if using RFP (4501)
        # some sites, e.g. Zoom, need a canvas site exception [Right Click>View Page Info>Permissions]
        # Discord video does not work: it thinks you are FF78: use a separate profile or spoof the user agent
        "media.peerconnection.enabled" = true;
        "media.peerconnection.ice.no_host" = false; # may or may not be required
        "webgl.min_capability_mode" = true;
        "media.autoplay.blocking_policy" =
          0; # optional (otherwise add site exceptions)
        "javascript.options.wasm" =
          true; # optional (some platforms may require this)
        "dom.webaudio.enabled" = true;
      };
  };
in
  self