Commit 1edfec57 authored by Alex Catarineu's avatar Alex Catarineu
Browse files

Bug 31598: Disable warning on window resize if letterboxing is enabled

parent 0efb110e
......@@ -92,6 +92,7 @@ var torbutton_unique_pref_observer =
m_tb_prefs.addObserver("plugin.disable", this, false);
m_tb_prefs.addObserver("privacy.firstparty.isolate", this, false);
m_tb_prefs.addObserver("privacy.resistFingerprinting", this, false);
m_tb_prefs.addObserver("privacy.resistFingerprinting.letterboxing", this, false);
// We observe xpcom-category-entry-added for plugins w/ Gecko-Content-Viewers
var observerService = Services.obs;
......@@ -107,6 +108,7 @@ var torbutton_unique_pref_observer =
m_tb_prefs.removeObserver("plugin.disable", this);
m_tb_prefs.removeObserver("privacy.firstparty.isolate", this);
m_tb_prefs.removeObserver("privacy.resistFingerprinting", this);
m_tb_prefs.removeObserver("privacy.resistFingerprinting.letterboxing", this);
var observerService = Services.obs;
observerService.removeObserver(this, "xpcom-category-entry-added");
......@@ -156,6 +158,7 @@ var torbutton_unique_pref_observer =
torbutton_use_nontor_proxy();
break;
case "privacy.resistFingerprinting":
case "privacy.resistFingerprinting.letterboxing":
torbutton_update_fingerprinting_prefs();
break;
case "privacy.firstparty.isolate":
......@@ -1508,14 +1511,14 @@ function torbutton_update_disk_prefs() {
function torbutton_update_fingerprinting_prefs() {
var mode = m_tb_prefs.getBoolPref("privacy.resistFingerprinting");
var letterboxing = m_tb_prefs.getBoolPref("privacy.resistFingerprinting.letterboxing", false);
m_tb_prefs.setBoolPref("webgl.disable-extensions", mode);
m_tb_prefs.setBoolPref("dom.network.enabled", !mode);
m_tb_prefs.setBoolPref("dom.enable_performance", !mode);
m_tb_prefs.setBoolPref("plugin.expose_full_path", !mode);
m_tb_prefs.setBoolPref("browser.zoom.siteSpecific", !mode);
m_tb_prefs.setBoolPref("extensions.torbutton.resize_new_windows", mode);
m_tb_prefs.setBoolPref("extensions.torbutton.resize_new_windows", mode && !letterboxing);
// Force prefs to be synced to disk
Services.prefs.savePrefFile(null);
......@@ -1915,8 +1918,7 @@ function torbutton_new_window(event)
let progress = Cc["@mozilla.org/docloaderservice;1"]
.getService(Ci.nsIWebProgress);
if (m_tb_prefs.getBoolPref("extensions.torbutton.resize_new_windows")
&& torbutton_is_windowed(window)) {
if (torbutton_is_windowed(window)) {
progress.addProgressListener(torbutton_resizelistener,
Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT);
}
......@@ -1999,8 +2001,8 @@ var torbutton_resizelistener =
await new Promise(resolve => setTimeout(resolve, 0));
if (window.windowState === window.STATE_MAXIMIZED ||
window.windowState === window.STATE_FULLSCREEN) {
if (m_tb_prefs.
getIntPref("extensions.torbutton.maximize_warnings_remaining") > 0) {
if (m_tb_prefs.getBoolPref("extensions.torbutton.resize_new_windows") &&
m_tb_prefs.getIntPref("extensions.torbutton.maximize_warnings_remaining") > 0) {
// Do not add another notification if one is already showing.
const kNotificationName = "torbutton-maximize-notification";
......
......@@ -30,7 +30,7 @@ pref("extensions.torbutton.cookie_protections",true);
pref("extensions.torbutton.cookie_auto_protect",false);
pref("extensions.torbutton.clear_http_auth",true);
pref("extensions.torbutton.close_newnym",true);
pref("extensions.torbutton.resize_new_windows",true);
pref("extensions.torbutton.resize_new_windows",false);
pref("extensions.torbutton.startup_state", 2); // 0=non-tor, 1=tor, 2=last
pref("extensions.torbutton.tor_memory_jar",false);
pref("extensions.torbutton.nontor_memory_jar",false);
......
Supports Markdown
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