tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

HomepageOverride.sys.mjs (807B)


      1 // FIXME: Eventually drop this entirely. It is only known to be used by Whonix,
      2 // which could set their default home page using "browser.startup.homepage".
      3 // See https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/13835#note_2928881
      4 export const HomepageOverride = {
      5  check() {
      6    // tor-browser#13835: Allow overriding the default homepage by setting a
      7    // custom environment variable.
      8    if (Services.env.exists("TOR_DEFAULT_HOMEPAGE")) {
      9      const prefName = "browser.startup.homepage";
     10      // if the user has set this value in a previous installation, don't
     11      // override it
     12      if (!Services.prefs.prefHasUserValue(prefName)) {
     13        Services.prefs.setCharPref(
     14          prefName,
     15          Services.env.get("TOR_DEFAULT_HOMEPAGE")
     16        );
     17      }
     18    }
     19  },
     20 };