GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still and

Commit ab7e47f4 authored by Kathleen Brade's avatar Kathleen Brade
Browse files

Bug 28044: Integrate Tor Launcher into tor-browser

To avoid potential conflicts with other preference files, rename
our default preferences file from pref.js to torlauncher-prefs.js.

Do not load default preferences if the browser has already done so.
parent 0ce8339e
// Copyright (c) 2018, The Tor Project, Inc.
// Copyright (c) 2019, The Tor Project, Inc.
// See LICENSE for licensing information.
// vim: set sw=2 sts=2 ts=8 et syntax=javascript:
......@@ -876,10 +876,30 @@ let TLUtilInternal = // Private
return this.mDefaultPreferencesLoaded;
// Check whether default preferences have already been loaded, e.g.,
// because Tor Launcher is integrated into the browser rather than
// running as an extension. This code assumes that a default value is
// defined for extensions.torlauncher.loglevel.
let prefName = "extensions.torlauncher.loglevel";
let val;
let defaultBranch = this._getPrefDefaultBranch(prefName);
val = defaultBranch.getIntPref("");
} catch (e) {}
if (val !== undefined)
this.mDefaultPreferencesLoaded = true;
return true;
// Use the JS subscript loaded in conjunction with our pref() function
// to load the default preferences.
const kPrefsURL =
var loader = Cc[";1"]
"resource://torlauncher/defaults/preferences/prefs.js", this);
loader.loadSubScript(kPrefsURL, this);
this.mDefaultPreferencesLoaded =
(this.mNumDefaultPrefsDefined == this.mNumDefaultPrefsLoaded);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment