diff options
author | Andreas Tolfsen <ato@mozilla.com> | 2017-04-04 17:22:07 +0300 |
---|---|---|
committer | jgraham <james@hoppipolla.co.uk> | 2017-04-04 19:42:28 +0300 |
commit | 2e0054b90ecf1acbe8b442af54441e3cc746933f (patch) | |
tree | 8206f580cecc3b34acdde1d60457f4670ddf2b10 | |
parent | 95ef3b49bc3fbeac231be22c19f06b7d14f6959b (diff) |
prefs, marionette: remove or move remaining required prefs
When a user provides a profile that wnats to override browser.warnOnQuit,
browser.tabs.warnOnClose, or browser.showQuitWarning, we should
allow users to do stupid things. We should not prevent the profile's
preferences from being applied.
dom.ipc.cpows.forbid-unsafe-from-browser is being removed because all
targetted Firefoxen are not using any unsafe CPOWs in Marionette code.
marionette.defaultPrefs.enabled is superfluous for as long as the
--marionette flag is being passed to the Firefox binary.
Remaining relevant prefs from prefs::REQUIRED have been merged into
prefs::DEFAULT.
This is a follow-up to the discussion around
https://github.com/mozilla/geckodriver/pull/423.
-rw-r--r-- | src/marionette.rs | 2 | ||||
-rw-r--r-- | src/prefs.rs | 29 |
2 files changed, 10 insertions, 21 deletions
diff --git a/src/marionette.rs b/src/marionette.rs index 4a517f1..5693e1e 100644 --- a/src/marionette.rs +++ b/src/marionette.rs @@ -351,8 +351,6 @@ impl MarionetteHandler { prefs.insert_slice(&extra_prefs[..]); - prefs.insert_slice(&prefs::REQUIRED[..]); - if let Some(ref level) = self.current_log_level { prefs.insert("marionette.logging", Pref::new(level.to_string())); }; diff --git a/src/prefs.rs b/src/prefs.rs index 4bee6aa..3e82850 100644 --- a/src/prefs.rs +++ b/src/prefs.rs @@ -1,7 +1,7 @@ use mozprofile::preferences::Pref; lazy_static! { - pub static ref DEFAULT: [(&'static str, Pref); 75] = [ + pub static ref DEFAULT: [(&'static str, Pref); 78] = [ // Disable automatic downloading of new releases ("app.update.auto", Pref::new(false)), @@ -65,6 +65,9 @@ lazy_static! { // Skip check for default browser on startup ("browser.shell.checkDefaultBrowser", Pref::new(false)), + // Do not warn when quitting with multiple tabs + ("browser.showQuitWarning", Pref::new(false)), + // Disable Android snippets ("browser.snippets.enabled", Pref::new(false)), ("browser.snippets.syncPromo.enabled", Pref::new(false)), @@ -88,6 +91,9 @@ lazy_static! { // might get unloaded ("browser.tabs.disableBackgroundZombification", Pref::new(false)), + // Do not warn on exit when multiple tabs are open + ("browser.tabs.warnOnClose", Pref::new(false)), + // Do not warn when closing all other open tabs ("browser.tabs.warnOnCloseOtherTabs", Pref::new(false)), @@ -100,6 +106,9 @@ lazy_static! { // Disable the UI tour ("browser.uitour.enabled", Pref::new(false)), + // Do not warn on quitting Firefox + ("browser.warnOnQuit", Pref::new(false)), + // Do not show datareporting policy notifications which can // interfere with tests ("datareporting.healthreport.about.reportUrl", Pref::new("http://%(server)s/dummy/abouthealthreport/")), @@ -214,22 +223,4 @@ lazy_static! { // We want to collect telemetry, but we don't want to send in the results ("toolkit.telemetry.server", Pref::new("https://%(server)s/dummy/telemetry/")), ]; - - pub static ref REQUIRED: [(&'static str, Pref); 5] = [ - // Do not warn on quitting Firefox - ("browser.warnOnQuit", Pref::new(false)), - - // Do not warn on exit when multiple tabs are open - ("browser.tabs.warnOnClose", Pref::new(false)), - - // Do not warn when quitting with multiple tabs - ("browser.showQuitWarning", Pref::new(false)), - - // Until bug 1238095 is fixed, we have to disable safe CPOW checks - ("dom.ipc.cpows.forbid-unsafe-from-browser", Pref::new(false)), - - // TODO(ato): Should not be needed, as Marionette is enabled by - // passing the --marionette flag to the binary - ("marionette.defaultPrefs.enabled", Pref::new(true)), - ]; } |