Source code

Revision control

Other Tools

1
use mozprofile::preferences::Pref;
2
3
// ALL CHANGES TO THIS FILE MUST HAVE REVIEW FROM A GECKODRIVER PEER!
4
//
5
// All preferences in this file are not immediately effective, and
6
// require a restart of Firefox, or have to be set in the profile before
7
// Firefox gets started the first time. If a preference has to be added,
8
// which is immediately effective, it needs to be done in Marionette
9
// (marionette.js).
10
//
11
// Note: geckodriver is used out-of-tree with various builds of Firefox.
12
// Removing a preference from this file will cause regressions,
13
// so please be careful and get review from a Testing :: geckodriver peer
14
// before you make any changes to this file.
15
lazy_static! {
16
pub static ref DEFAULT: Vec<(&'static str, Pref)> = vec![
17
// Make sure Shield doesn't hit the network.
18
("app.normandy.api_url", Pref::new("")),
19
20
// Disable Firefox old build background check
21
("app.update.checkInstallTime", Pref::new(false)),
22
23
// Disable automatically upgrading Firefox
24
//
25
// Note: Possible update tests could reset or flip the value to allow
26
// updates to be downloaded and applied.
27
("app.update.disabledForTesting", Pref::new(true)),
28
// !!! For backward compatibility up to Firefox 64. Only remove
29
// when this Firefox version is no longer supported by geckodriver !!!
30
("app.update.auto", Pref::new(false)),
31
32
// Enable the dump function, which sends messages to the system
33
// console
34
("browser.dom.window.dump.enabled", Pref::new(true)),
35
("devtools.console.stdout.chrome", Pref::new(true)),
36
37
// Disable safebrowsing components
38
("browser.safebrowsing.blockedURIs.enabled", Pref::new(false)),
39
("browser.safebrowsing.downloads.enabled", Pref::new(false)),
40
("browser.safebrowsing.passwords.enabled", Pref::new(false)),
41
("browser.safebrowsing.malware.enabled", Pref::new(false)),
42
("browser.safebrowsing.phishing.enabled", Pref::new(false)),
43
44
// Do not restore the last open set of tabs if the browser crashed
45
("browser.sessionstore.resume_from_crash", Pref::new(false)),
46
47
// Skip check for default browser on startup
48
("browser.shell.checkDefaultBrowser", Pref::new(false)),
49
50
// Do not redirect user when a milestone upgrade of Firefox
51
// is detected
52
("browser.startup.homepage_override.mstone", Pref::new("ignore")),
53
54
// Start with a blank page (about:blank)
55
("browser.startup.page", Pref::new(0)),
56
57
// Do not close the window when the last tab gets closed
58
// TODO: Remove once minimum supported Firefox release is 61.
59
("browser.tabs.closeWindowWithLastTab", Pref::new(false)),
60
61
// Do not warn when closing all open tabs
62
// TODO: Remove once minimum supported Firefox release is 61.
63
("browser.tabs.warnOnClose", Pref::new(false)),
64
65
// Disable the UI tour
66
("browser.uitour.enabled", Pref::new(false)),
67
68
// Do not warn on quitting Firefox
69
("browser.warnOnQuit", Pref::new(false)),
70
71
// Do not show datareporting policy notifications which can
72
// interfere with tests
73
("datareporting.healthreport.about.reportUrl", Pref::new("http://%(server)s/dummy/abouthealthreport/")), // removed in Firefox 59
74
("datareporting.healthreport.documentServerURI", Pref::new("http://%(server)s/dummy/healthreport/")),
75
("datareporting.healthreport.logging.consoleEnabled", Pref::new(false)),
76
("datareporting.healthreport.service.enabled", Pref::new(false)),
77
("datareporting.healthreport.service.firstRun", Pref::new(false)),
78
("datareporting.healthreport.uploadEnabled", Pref::new(false)),
79
("datareporting.policy.dataSubmissionEnabled", Pref::new(false)),
80
("datareporting.policy.dataSubmissionPolicyAccepted", Pref::new(false)),
81
("datareporting.policy.dataSubmissionPolicyBypassNotification", Pref::new(true)),
82
83
// Disable the ProcessHangMonitor
84
("dom.ipc.reportProcessHangs", Pref::new(false)),
85
86
// Only load extensions from the application and user profile
87
// AddonManager.SCOPE_PROFILE + AddonManager.SCOPE_APPLICATION
88
("extensions.autoDisableScopes", Pref::new(0)),
89
("extensions.enabledScopes", Pref::new(5)),
90
91
// Disable intalling any distribution extensions or add-ons
92
("extensions.installDistroAddons", Pref::new(false)),
93
94
// Disable extensions compatibility dialogue.
95
// TODO: Remove once minimum supported Firefox release is 61.
96
("extensions.showMismatchUI", Pref::new(false)),
97
98
// Turn off extension updates so they do not bother tests
99
("extensions.update.enabled", Pref::new(false)),
100
("extensions.update.notifyUser", Pref::new(false)),
101
102
// Allow the application to have focus even it runs in the
103
// background
104
("focusmanager.testmode", Pref::new(true)),
105
106
// Disable useragent updates
107
("general.useragent.updates.enabled", Pref::new(false)),
108
109
// Always use network provider for geolocation tests so we bypass
110
// the macOS dialog raised by the corelocation provider
111
("geo.provider.testing", Pref::new(true)),
112
113
// Do not scan wi-fi
114
("geo.wifi.scan", Pref::new(false)),
115
116
// No hang monitor
117
("hangmonitor.timeout", Pref::new(0)),
118
119
// Show chrome errors and warnings in the error console
120
("javascript.options.showInConsole", Pref::new(true)),
121
122
// Disable download and usage of OpenH264, and Widevine plugins
123
("media.gmp-manager.updateEnabled", Pref::new(false)),
124
125
// Do not prompt with long usernames or passwords in URLs
126
// TODO: Remove once minimum supported Firefox release is 61.
127
("network.http.phishy-userpass-length", Pref::new(255)),
128
129
// Do not automatically switch between offline and online
130
("network.manage-offline-status", Pref::new(false)),
131
132
// Make sure SNTP requests do not hit the network
133
("network.sntp.pools", Pref::new("%(server)s")),
134
135
// Disable Flash. The plugin container it is run in is
136
// causing problems when quitting Firefox from geckodriver,
138
("plugin.state.flash", Pref::new(0)),
139
140
// Don't do network connections for mitm priming
141
("security.certerrors.mitm.priming.enabled", Pref::new(false)),
142
143
// Ensure blocklist updates don't hit the network
144
("services.settings.server", Pref::new("http://%(server)s/dummy/blocklist/")),
145
146
// Disable first run pages
147
("startup.homepage_welcome_url", Pref::new("about:blank")),
148
("startup.homepage_welcome_url.additional", Pref::new("")),
149
150
// Prevent starting into safe mode after application crashes
151
("toolkit.startup.max_resumed_crashes", Pref::new(-1)),
152
153
// We want to collect telemetry, but we don't want to send in the results
154
("toolkit.telemetry.server", Pref::new("https://%(server)s/dummy/telemetry/")),
155
];
156
}