Bumping manifests a=b2g-bump
[gecko.git] / b2g / app / b2g.js
blob12c0f33a8ddc3e4c9051c2fc3cf8fdbba070a211
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #filter substitution
7 #ifndef MOZ_MULET
8 pref("toolkit.defaultChromeURI", "chrome://b2g/content/shell.html");
9 pref("browser.chromeURL", "chrome://b2g/content/");
10 #endif
12 #ifdef MOZ_MULET
13 // Set FxOS as the default homepage
14 // bug 1000122: this pref is fetched as a complex value,
15 // so that it can't be set a just a string.
16 // data: url is a workaround this.
17 pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=chrome://b2g/content/shell.html");
18 // Prevent having the firstrun page
19 pref("startup.homepage_welcome_url", "");
20 pref("browser.shell.checkDefaultBrowser", false);
21 // Automatically open devtools on the firefox os panel
22 pref("devtools.toolbox.host", "side");
23 pref("devtools.toolbox.sidebar.width", 800);
24 // Disable session store to ensure having only one tab opened
25 pref("browser.sessionstore.max_tabs_undo", 0);
26 pref("browser.sessionstore.max_windows_undo", 0);
27 pref("browser.sessionstore.restore_on_demand", false);
28 pref("browser.sessionstore.resume_from_crash", false);
29 #endif
31 // Bug 945235: Prevent all bars to be considered visible:
32 pref("toolkit.defaultChromeFeatures", "chrome,dialog=no,close,resizable,scrollbars,extrachrome");
34 // Device pixel to CSS px ratio, in percent. Set to -1 to calculate based on display density.
35 pref("browser.viewport.scaleRatio", -1);
37 /* disable text selection */
38 pref("browser.ignoreNativeFrameTextSelection", true);
40 /* cache prefs */
41 #ifdef MOZ_WIDGET_GONK
42 pref("browser.cache.disk.enable", true);
43 pref("browser.cache.disk.capacity", 55000); // kilobytes
44 pref("browser.cache.disk.parent_directory", "/cache");
45 #endif
46 pref("browser.cache.disk.smart_size.enabled", false);
47 pref("browser.cache.disk.smart_size.first_run", false);
49 pref("browser.cache.memory.enable", true);
50 pref("browser.cache.memory.capacity", 1024); // kilobytes
52 pref("browser.cache.memory_limit", 2048); // 2 MB
54 /* image cache prefs */
55 pref("image.cache.size", 1048576); // bytes
56 pref("image.high_quality_downscaling.enabled", false);
57 pref("canvas.image.cache.limit", 20971520); // 20 MB
59 /* offline cache prefs */
60 pref("browser.offline-apps.notify", false);
61 pref("browser.cache.offline.enable", true);
62 pref("offline-apps.allow_by_default", true);
64 /* protocol warning prefs */
65 pref("network.protocol-handler.warn-external.tel", false);
66 pref("network.protocol-handler.warn-external.mailto", false);
67 pref("network.protocol-handler.warn-external.vnd.youtube", false);
69 /* http prefs */
70 pref("network.http.pipelining", true);
71 pref("network.http.pipelining.ssl", true);
72 pref("network.http.proxy.pipelining", true);
73 pref("network.http.pipelining.maxrequests" , 6);
74 pref("network.http.keep-alive.timeout", 109);
75 pref("network.http.max-connections", 20);
76 pref("network.http.max-persistent-connections-per-server", 6);
77 pref("network.http.max-persistent-connections-per-proxy", 20);
79 // Keep the old default of accepting all cookies,
80 // no matter if you already visited the website or not
81 pref("network.cookie.cookieBehavior", 0);
83 // spdy
84 pref("network.http.spdy.enabled.http2draft", false);
85 pref("network.http.spdy.push-allowance", 32768);
87 // See bug 545869 for details on why these are set the way they are
88 pref("network.buffer.cache.count", 24);
89 pref("network.buffer.cache.size",  16384);
91 // predictive actions
92 pref("network.predictor.enable", false); // disabled on b2g
93 pref("network.predictor.max-db-size", 2097152); // bytes
94 pref("network.predictor.preserve", 50); // percentage of predictor data to keep when cleaning up
96 /* session history */
97 pref("browser.sessionhistory.max_total_viewers", 1);
98 pref("browser.sessionhistory.max_entries", 50);
100 /* session store */
101 pref("browser.sessionstore.resume_session_once", false);
102 pref("browser.sessionstore.resume_from_crash", true);
103 pref("browser.sessionstore.resume_from_crash_timeout", 60); // minutes
104 pref("browser.sessionstore.interval", 10000); // milliseconds
105 pref("browser.sessionstore.max_tabs_undo", 1);
107 /* these should help performance */
108 pref("mozilla.widget.force-24bpp", true);
109 pref("mozilla.widget.use-buffer-pixmap", true);
110 pref("mozilla.widget.disable-native-theme", true);
111 pref("layout.reflow.synthMouseMove", false);
112 pref("layers.enable-tiles", true);
113 pref("layers.low-precision-buffer", true);
114 pref("layers.low-precision-opacity", "0.5");
116    Cross Process Mutex is not supported on Mac OS X so progressive
117    paint cannot be enabled for B2G on Mac OS X desktop
119 #ifdef MOZ_WIDGET_COCOA
120 pref("layers.progressive-paint", false);
121 #else
122 pref("layers.progressive-paint", true);
123 #endif
125 /* download manager (don't show the window or alert) */
126 pref("browser.download.useDownloadDir", true);
127 pref("browser.download.folderList", 1); // Default to ~/Downloads
128 pref("browser.download.manager.showAlertOnComplete", false);
129 pref("browser.download.manager.showAlertInterval", 2000);
130 pref("browser.download.manager.retention", 2);
131 pref("browser.download.manager.showWhenStarting", false);
132 pref("browser.download.manager.closeWhenDone", true);
133 pref("browser.download.manager.openDelay", 0);
134 pref("browser.download.manager.focusWhenStarting", false);
135 pref("browser.download.manager.flashCount", 2);
136 pref("browser.download.manager.displayedHistoryDays", 7);
138 /* download helper */
139 pref("browser.helperApps.deleteTempFileOnExit", false);
141 /* password manager */
142 pref("signon.rememberSignons", true);
143 pref("signon.expireMasterPassword", false);
145 /* autocomplete */
146 pref("browser.formfill.enable", true);
148 /* spellcheck */
149 pref("layout.spellcheckDefault", 0);
151 /* block popups by default, and notify the user about blocked popups */
152 pref("dom.disable_open_during_load", true);
153 pref("privacy.popups.showBrowserMessage", true);
155 pref("keyword.enabled", true);
156 pref("browser.fixup.domainwhitelist.localhost", true);
158 pref("accessibility.typeaheadfind", false);
159 pref("accessibility.typeaheadfind.timeout", 5000);
160 pref("accessibility.typeaheadfind.flashBar", 1);
161 pref("accessibility.typeaheadfind.linksonly", false);
162 pref("accessibility.typeaheadfind.casesensitive", 0);
164 // SSL error page behaviour
165 pref("browser.ssl_override_behavior", 2);
166 pref("browser.xul.error_pages.expert_bad_cert", false);
168 // disable logging for the search service by default
169 pref("browser.search.log", false);
171 // disable updating
172 pref("browser.search.update", false);
173 pref("browser.search.update.log", false);
174 pref("browser.search.updateinterval", 6);
176 // enable search suggestions by default
177 pref("browser.search.suggest.enabled", true);
179 // tell the search service that we don't really expose the "current engine"
180 pref("browser.search.noCurrentEngine", true);
182 // enable xul error pages
183 pref("browser.xul.error_pages.enabled", true);
185 // disable color management
186 pref("gfx.color_management.mode", 0);
188 // don't allow JS to move and resize existing windows
189 pref("dom.disable_window_move_resize", true);
191 // prevent click image resizing for nsImageDocument
192 pref("browser.enable_click_image_resizing", false);
194 // controls which bits of private data to clear. by default we clear them all.
195 pref("privacy.item.cache", true);
196 pref("privacy.item.cookies", true);
197 pref("privacy.item.offlineApps", true);
198 pref("privacy.item.history", true);
199 pref("privacy.item.formdata", true);
200 pref("privacy.item.downloads", true);
201 pref("privacy.item.passwords", true);
202 pref("privacy.item.sessions", true);
203 pref("privacy.item.geolocation", true);
204 pref("privacy.item.siteSettings", true);
205 pref("privacy.item.syncAccount", true);
207 // base url for the wifi geolocation network provider
208 pref("geo.provider.use_mls", false);
209 pref("geo.cell.scan", true);
210 pref("geo.wifi.uri", "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%");
212 // enable geo
213 pref("geo.enabled", true);
215 // content sink control -- controls responsiveness during page load
216 // see https://bugzilla.mozilla.org/show_bug.cgi?id=481566#c9
217 pref("content.sink.enable_perf_mode",  2); // 0 - switch, 1 - interactive, 2 - perf
218 pref("content.sink.pending_event_mode", 0);
219 pref("content.sink.perf_deflect_count", 1000000);
220 pref("content.sink.perf_parse_time", 50000000);
222 // Maximum scripts runtime before showing an alert
223 // Disable the watchdog thread for B2G. See bug 870043 comment 31.
224 pref("dom.use_watchdog", false);
226 // The slow script dialog can be triggered from inside the JS engine as well,
227 // ensure that those calls don't accidentally trigger the dialog.
228 pref("dom.max_script_run_time", 0);
229 pref("dom.max_chrome_script_run_time", 0);
231 // plugins
232 pref("plugin.disable", true);
233 pref("dom.ipc.plugins.enabled", true);
235 // product URLs
236 // The breakpad report server to link to in about:crashes
237 pref("breakpad.reportURL", "https://crash-stats.mozilla.com/report/index/");
238 pref("app.releaseNotesURL", "http://www.mozilla.com/%LOCALE%/b2g/%VERSION%/releasenotes/");
239 pref("app.support.baseURL", "http://support.mozilla.com/b2g");
240 pref("app.privacyURL", "http://www.mozilla.com/%LOCALE%/m/privacy.html");
241 pref("app.creditsURL", "http://www.mozilla.org/credits/");
242 pref("app.featuresURL", "http://www.mozilla.com/%LOCALE%/b2g/features/");
243 pref("app.faqURL", "http://www.mozilla.com/%LOCALE%/b2g/faq/");
245 // Name of alternate about: page for certificate errors (when undefined, defaults to about:neterror)
246 pref("security.alternate_certificate_error_page", "certerror");
248 pref("security.warn_viewing_mixed", false); // Warning is disabled.  See Bug 616712.
250 // 2 = strict certificate pinning checks.
251 // This default preference is more strict than Firefox because B2G
252 // currently does not have a way to install local root certificates.
253 // Strict checking is effectively equivalent to non-strict checking as
254 // long as that is true.  If an ability to add local certificates is
255 // added, there may be a need to change this pref.
256 pref("security.cert_pinning.enforcement_level", 2);
259 // Override some named colors to avoid inverse OS themes
260 pref("ui.-moz-dialog", "#efebe7");
261 pref("ui.-moz-dialogtext", "#101010");
262 pref("ui.-moz-field", "#fff");
263 pref("ui.-moz-fieldtext", "#1a1a1a");
264 pref("ui.-moz-buttonhoverface", "#f3f0ed");
265 pref("ui.-moz-buttonhovertext", "#101010");
266 pref("ui.-moz-combobox", "#fff");
267 pref("ui.-moz-comboboxtext", "#101010");
268 pref("ui.buttonface", "#ece7e2");
269 pref("ui.buttonhighlight", "#fff");
270 pref("ui.buttonshadow", "#aea194");
271 pref("ui.buttontext", "#101010");
272 pref("ui.captiontext", "#101010");
273 pref("ui.graytext", "#b1a598");
274 pref("ui.highlighttext", "#1a1a1a");
275 pref("ui.threeddarkshadow", "#000");
276 pref("ui.threedface", "#ece7e2");
277 pref("ui.threedhighlight", "#fff");
278 pref("ui.threedlightshadow", "#ece7e2");
279 pref("ui.threedshadow", "#aea194");
280 pref("ui.windowframe", "#efebe7");
282 // Themable via mozSettings
283 pref("ui.menu", "#f97c17");
284 pref("ui.menutext", "#ffffff");
285 pref("ui.infobackground", "#343e40");
286 pref("ui.infotext", "#686868");
287 pref("ui.window", "#ffffff");
288 pref("ui.windowtext", "#000000");
289 pref("ui.highlight", "#b2f2ff");
291 // replace newlines with spaces on paste into single-line text boxes
292 pref("editor.singleLine.pasteNewlines", 2);
294 // threshold where a tap becomes a drag, in 1/240" reference pixels
295 // The names of the preferences are to be in sync with EventStateManager.cpp
296 pref("ui.dragThresholdX", 25);
297 pref("ui.dragThresholdY", 25);
299 // Layers Acceleration.  We can only have nice things on gonk, because
300 // they're not maintained anywhere else.
301 pref("layers.offmainthreadcomposition.enabled", true);
302 pref("layers.offmainthreadcomposition.async-animations", true);
303 #ifndef MOZ_WIDGET_GONK
304 pref("dom.ipc.tabs.disabled", true);
305 #else
306 pref("dom.ipc.tabs.disabled", false);
307 pref("layers.acceleration.disabled", false);
308 pref("layers.async-pan-zoom.enabled", true);
309 pref("gfx.content.azure.backends", "cairo");
310 #endif
312 // Web Notifications
313 pref("notification.feature.enabled", true);
315 // IndexedDB
316 pref("dom.indexedDB.warningQuota", 5);
318 // prevent video elements from preloading too much data
319 pref("media.preload.default", 1); // default to preload none
320 pref("media.preload.auto", 2);    // preload metadata if preload=auto
321 pref("media.cache_size", 4096);    // 4MB media cache
322 #ifdef MOZ_FMP4
323 // Enable/Disable Gonk Decoder Module
324 pref("media.fragmented-mp4.gonk.enabled", false);
325 #endif
326 // The default number of decoded video frames that are enqueued in
327 // MediaDecoderReader's mVideoQueue.
328 pref("media.video-queue.default-size", 3);
330 // optimize images' memory usage
331 pref("image.mem.decodeondraw", true);
332 pref("image.mem.allow_locking_in_content_processes", false); /* don't allow image locking */
333 pref("image.mem.min_discard_timeout_ms", 86400000); /* 24h, we rely on the out of memory hook */
334 pref("image.mem.max_decoded_image_kb", 30000); /* 30MB seems reasonable */
335 // 65MB seems reasonable and layout/reftests/bugs/370629-1.html requires more than 62MB
336 pref("image.mem.hard_limit_decoded_image_kb", 66560);
337 pref("image.onload.decode.limit", 24); /* don't decode more than 24 images eagerly */
339 // XXX this isn't a good check for "are touch events supported", but
340 // we don't really have a better one at the moment.
341 // enable touch events interfaces
342 pref("dom.w3c_touch_events.enabled", 1);
343 pref("dom.w3c_touch_events.safetyX", 0); // escape borders in units of 1/240"
344 pref("dom.w3c_touch_events.safetyY", 120); // escape borders in units of 1/240"
346 #ifdef MOZ_SAFE_BROWSING
347 // Safe browsing does nothing unless this pref is set
348 pref("browser.safebrowsing.enabled", true);
350 // Prevent loading of pages identified as malware
351 pref("browser.safebrowsing.malware.enabled", true);
353 // Non-enhanced mode (local url lists) URL list to check for updates
354 pref("browser.safebrowsing.provider.0.updateURL", "https://safebrowsing.google.com/safebrowsing/downloads?client={moz:client}&appver={moz:version}&pver=2.2&key=%GOOGLE_API_KEY%");
356 pref("browser.safebrowsing.dataProvider", 0);
358 // Does the provider name need to be localizable?
359 pref("browser.safebrowsing.provider.0.name", "Google");
360 pref("browser.safebrowsing.provider.0.reportURL", "https://safebrowsing.google.com/safebrowsing/report?");
361 pref("browser.safebrowsing.provider.0.gethashURL", "https://safebrowsing.google.com/safebrowsing/gethash?client={moz:client}&appver={moz:version}&pver=2.2");
363 // HTML report pages
364 pref("browser.safebrowsing.provider.0.reportGenericURL", "http://{moz:locale}.phish-generic.mozilla.com/?hl={moz:locale}");
365 pref("browser.safebrowsing.provider.0.reportErrorURL", "http://{moz:locale}.phish-error.mozilla.com/?hl={moz:locale}");
366 pref("browser.safebrowsing.provider.0.reportPhishURL", "http://{moz:locale}.phish-report.mozilla.com/?hl={moz:locale}");
367 pref("browser.safebrowsing.provider.0.reportMalwareURL", "http://{moz:locale}.malware-report.mozilla.com/?hl={moz:locale}");
368 pref("browser.safebrowsing.provider.0.reportMalwareErrorURL", "http://{moz:locale}.malware-error.mozilla.com/?hl={moz:locale}");
370 // FAQ URLs
372 // Name of the about: page contributed by safebrowsing to handle display of error
373 // pages on phishing/malware hits.  (bug 399233)
374 pref("urlclassifier.alternate_error_page", "blocked");
376 // The number of random entries to send with a gethash request.
377 pref("urlclassifier.gethashnoise", 4);
379 // If an urlclassifier table has not been updated in this number of seconds,
380 // a gethash request will be forced to check that the result is still in
381 // the database.
382 pref("urlclassifier.max-complete-age", 2700);
384 // URL for checking the reason for a malware warning.
385 pref("browser.safebrowsing.malware.reportURL", "https://safebrowsing.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site=");
386 #endif
388 // True if this is the first time we are showing about:firstrun
389 pref("browser.firstrun.show.uidiscovery", true);
390 pref("browser.firstrun.show.localepicker", true);
392 // initiated by a user
393 pref("content.ime.strict_policy", true);
395 // True if you always want dump() to work
397 // On Android, you also need to do the following for the output
398 // to show up in logcat:
400 // $ adb shell stop
401 // $ adb shell setprop log.redirect-stdio true
402 // $ adb shell start
403 pref("browser.dom.window.dump.enabled", false);
405 // Default Content Security Policy to apply to certified apps.
406 // If you change this CSP, make sure to update the fast path in nsCSPService.cpp
407 pref("security.apps.certified.CSP.default", "default-src *; script-src 'self'; object-src 'none'; style-src 'self' 'unsafe-inline' app://theme.gaiamobile.org");
408 // Default Content Security Policy to apply to trusted apps.
409 pref("security.apps.trusted.CSP.default", "default-src *; object-src 'none'; frame-src 'none'");
411 // Temporarily force-enable GL compositing.  This is default-disabled
412 // deep within the bowels of the widgetry system.  Remove me when GL
413 // compositing isn't default disabled in widget/android.
414 pref("layers.acceleration.force-enabled", true);
416 // handle links targeting new windows
417 // 1=current window/tab, 2=new window, 3=new tab in most recent window
418 pref("browser.link.open_newwindow", 3);
420 // 0: no restrictions - divert everything
421 // 1: don't divert window.open at all
422 // 2: don't divert window.open with features
423 pref("browser.link.open_newwindow.restriction", 0);
425 // Enable browser frames (including OOP, except on Windows, where it doesn't
426 // work), but make in-process browser frames the default.
427 pref("dom.mozBrowserFramesEnabled", true);
429 // Enable a (virtually) unlimited number of mozbrowser processes.
430 // We'll run out of PIDs on UNIX-y systems before we hit this limit.
431 pref("dom.ipc.processCount", 100000);
433 pref("dom.ipc.browser_frames.oop_by_default", false);
434 pref("dom.browser_frames.useAsyncPanZoom", true);
436 // SMS/MMS
437 pref("dom.sms.enabled", true);
439 //The waiting time in network manager.
440 pref("network.gonk.ms-release-mms-connection", 30000);
442 // WebContacts
443 pref("dom.mozContacts.enabled", true);
445 // Shortnumber matching needed for e.g. Brazil:
446 // 03187654321 can be found with 87654321
447 pref("dom.phonenumber.substringmatching.BR", 8);
448 pref("dom.phonenumber.substringmatching.CO", 10);
449 pref("dom.phonenumber.substringmatching.VE", 7);
450 pref("dom.phonenumber.substringmatching.CL", 8);
451 pref("dom.phonenumber.substringmatching.PE", 7);
453 // WebAlarms
454 pref("dom.mozAlarms.enabled", true);
456 // SimplePush
457 pref("services.push.enabled", true);
458 // Debugging enabled.
459 pref("services.push.debug", false);
460 // Is the network connection allowed to be up?
461 // This preference should be used in UX to enable/disable push.
462 pref("services.push.connection.enabled", true);
463 // serverURL to be assigned by services team
464 pref("services.push.serverURL", "wss://push.services.mozilla.com/");
465 pref("services.push.userAgentID", "");
466 // Exponential back-off start is 5 seconds like in HTTP/1.1.
467 // Maximum back-off is pingInterval.
468 pref("services.push.retryBaseInterval", 5000);
469 // Interval at which to ping PushServer to check connection status. In
470 // milliseconds. If no reply is received within requestTimeout, the connection
471 // is considered closed.
472 pref("services.push.pingInterval", 1800000); // 30 minutes
473 // How long before a DOMRequest errors as timeout
474 pref("services.push.requestTimeout", 10000);
475 pref("services.push.pingInterval.default", 180000);// 3 min
476 pref("services.push.pingInterval.mobile", 180000); // 3 min
477 pref("services.push.pingInterval.wifi", 180000);  // 3 min
478 // Adaptive ping
479 pref("services.push.adaptive.enabled", true);
480 pref("services.push.adaptive.lastGoodPingInterval", 180000);// 3 min
481 pref("services.push.adaptive.lastGoodPingInterval.mobile", 180000);// 3 min
482 pref("services.push.adaptive.lastGoodPingInterval.wifi", 180000);// 3 min
483 // Valid gap between the biggest good ping and the bad ping
484 pref("services.push.adaptive.gap", 60000); // 1 minute
485 // We limit the ping to this maximum value
486 pref("services.push.adaptive.upperLimit", 1740000); // 29 min
487 // enable udp wakeup support
488 pref("services.push.udp.wakeupEnabled", true);
490 // NetworkStats
491 #ifdef MOZ_WIDGET_GONK
492 pref("dom.mozNetworkStats.enabled", true);
493 pref("dom.webapps.firstRunWithSIM", true);
494 #endif
496 // ResourceStats
497 #ifdef MOZ_WIDGET_GONK
498 pref("dom.resource_stats.enabled", true);
499 #endif
501 #ifdef MOZ_B2G_RIL
502 // SingleVariant
503 pref("dom.mozApps.single_variant_sourcedir", "/persist/svoperapps");
504 #endif
506 // WebSettings
507 pref("dom.mozSettings.enabled", true);
508 pref("dom.mozPermissionSettings.enabled", true);
510 // controls if we want camera support
511 pref("device.camera.enabled", true);
512 pref("media.realtime_decoder.enabled", true);
514 // TCPSocket
515 pref("dom.mozTCPSocket.enabled", true);
517 // WebPayment
518 pref("dom.mozPay.enabled", true);
520 // "Preview" landing of bug 710563, which is bogged down in analysis
521 // of talos regression.  This is a needed change for higher-framerate
522 // CSS animations, and incidentally works around an apparent bug in
523 // our handling of requestAnimationFrame() listeners, which are
524 // supposed to enable this REPEATING_PRECISE_CAN_SKIP behavior.  The
525 // secondary bug isn't really worth investigating since it's obseleted
526 // by bug 710563.
527 pref("layout.frame_rate.precise", true);
529 // Handle hardware buttons in the b2g chrome package
530 pref("b2g.keys.menu.enabled", true);
532 // Screen timeout in seconds
533 pref("power.screen.timeout", 60);
535 pref("full-screen-api.enabled", true);
537 #ifndef MOZ_WIDGET_GONK
538 // If we're not actually on physical hardware, don't make the top level widget
539 // fullscreen when transitioning to fullscreen. This means in emulated
540 // environments (like the b2g desktop client) we won't make the client window
541 // fill the whole screen, we'll just make the content fill the client window,
542 // i.e. it won't give the impression to content that the number of device
543 // screen pixels changes!
544 pref("full-screen-api.ignore-widgets", true);
545 #endif
547 pref("media.volume.steps", 10);
549 #ifdef ENABLE_MARIONETTE
550 //Enable/disable marionette server, set listening port
551 pref("marionette.defaultPrefs.enabled", true);
552 pref("marionette.defaultPrefs.port", 2828);
553 #ifndef MOZ_WIDGET_GONK
554 // On desktop builds, we need to force the socket to listen on localhost only
555 pref("marionette.force-local", true);
556 #endif
557 #endif
559 #ifdef MOZ_UPDATER
560 // When we're applying updates, we can't let anything hang us on
561 // quit+restart.  The user has no recourse.
562 pref("shutdown.watchdog.timeoutSecs", 10);
563 // Timeout before the update prompt automatically installs the update
564 pref("b2g.update.apply-prompt-timeout", 60000); // milliseconds
565 // Amount of time to wait after the user is idle before prompting to apply an update
566 pref("b2g.update.apply-idle-timeout", 600000); // milliseconds
567 // Amount of time after which connection will be restarted if no progress
568 pref("b2g.update.download-watchdog-timeout", 120000); // milliseconds
569 pref("b2g.update.download-watchdog-max-retries", 5);
571 pref("app.update.enabled", true);
572 pref("app.update.auto", false);
573 pref("app.update.silent", false);
574 pref("app.update.mode", 0);
575 pref("app.update.incompatible.mode", 0);
576 pref("app.update.staging.enabled", true);
577 pref("app.update.service.enabled", true);
579 pref("app.update.url", "https://aus4.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%PRODUCT_DEVICE%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
580 pref("app.update.channel", "@MOZ_UPDATE_CHANNEL@");
582 // Interval at which update manifest is fetched.  In units of seconds.
583 pref("app.update.interval", 86400); // 1 day
584 // Don't throttle background updates.
585 pref("app.update.download.backgroundInterval", 0);
587 // Retry update socket connections every 30 seconds in the cases of certain kinds of errors
588 pref("app.update.socket.retryTimeout", 30000);
590 // Max of 20 consecutive retries (total 10 minutes) before giving up and marking
591 // the update download as failed.
592 // Note: Offline errors will always retry when the network comes online.
593 pref("app.update.socket.maxErrors", 20);
595 // Enable update logging for now, to diagnose growing pains in the
596 // field.
597 pref("app.update.log", true);
598 #else
599 // Explicitly disable the shutdown watchdog.  It's enabled by default.
600 // When the updater is disabled, we want to know about shutdown hangs.
601 pref("shutdown.watchdog.timeoutSecs", -1);
602 #endif
604 // Check daily for apps updates.
605 pref("webapps.update.interval", 86400);
607 // Extensions preferences
608 pref("extensions.update.enabled", false);
609 pref("extensions.getAddons.cache.enabled", false);
611 // Context Menu
612 pref("ui.click_hold_context_menus", true);
613 pref("ui.click_hold_context_menus.delay", 400);
615 // Enable device storage
616 pref("device.storage.enabled", true);
618 // Enable pre-installed applications
619 pref("dom.webapps.useCurrentProfile", true);
621 // Enable system message
622 pref("dom.sysmsg.enabled", true);
623 pref("media.plugins.enabled", false);
624 pref("media.omx.enabled", true);
625 pref("media.rtsp.enabled", true);
626 pref("media.rtsp.video.enabled", true);
628 // Disable printing (particularly, window.print())
629 pref("dom.disable_window_print", true);
631 // Disable window.showModalDialog
632 pref("dom.disable_window_showModalDialog", true);
634 // Enable new experimental html forms
635 pref("dom.experimental_forms", true);
636 pref("dom.forms.number", true);
638 // Don't enable <input type=color> yet as we don't have a color picker
639 // implemented for b2g (bug 875751)
640 pref("dom.forms.color", false);
642 // Turns on gralloc-based direct texturing for Gonk
643 pref("gfx.gralloc.enabled", false);
645 // This preference instructs the JS engine to discard the
646 // source of any privileged JS after compilation. This saves
647 // memory, but makes things like Function.prototype.toSource()
648 // fail.
649 pref("javascript.options.discardSystemSource", true);
651 // XXXX REMOVE FOR PRODUCTION. Turns on GC and CC logging
652 pref("javascript.options.mem.log", false);
654 // Increase mark slice time from 10ms to 30ms
655 pref("javascript.options.mem.gc_incremental_slice_ms", 30);
657 // Increase time to get more high frequency GC on benchmarks from 1000ms to 1500ms
658 pref("javascript.options.mem.gc_high_frequency_time_limit_ms", 1500);
660 pref("javascript.options.mem.gc_high_frequency_heap_growth_max", 300);
661 pref("javascript.options.mem.gc_high_frequency_heap_growth_min", 120);
662 pref("javascript.options.mem.gc_high_frequency_high_limit_mb", 40);
663 pref("javascript.options.mem.gc_high_frequency_low_limit_mb", 0);
664 pref("javascript.options.mem.gc_low_frequency_heap_growth", 120);
665 pref("javascript.options.mem.high_water_mark", 6);
666 pref("javascript.options.mem.gc_allocation_threshold_mb", 1);
667 pref("javascript.options.mem.gc_decommit_threshold_mb", 1);
668 #ifdef JSGC_GENERATIONAL
669 pref("javascript.options.mem.gc_min_empty_chunk_count", 1);
670 #else
671 pref("javascript.options.mem.gc_min_empty_chunk_count", 0);
672 #endif
673 pref("javascript.options.mem.gc_max_empty_chunk_count", 2);
675 // Show/Hide scrollbars when active/inactive
676 pref("ui.showHideScrollbars", 1);
677 pref("ui.useOverlayScrollbars", 1);
678 pref("ui.scrollbarFadeBeginDelay", 450);
679 pref("ui.scrollbarFadeDuration", 200);
681 // Enable the ProcessPriorityManager, and give processes with no visible
682 // documents a 1s grace period before they're eligible to be marked as
683 // background. Background processes that are perceivable due to playing
684 // media are given a longer grace period to accomodate changing tracks, etc.
685 pref("dom.ipc.processPriorityManager.enabled", true);
686 pref("dom.ipc.processPriorityManager.backgroundGracePeriodMS", 1000);
687 pref("dom.ipc.processPriorityManager.backgroundPerceivableGracePeriodMS", 5000);
688 pref("dom.ipc.processPriorityManager.temporaryPriorityLockMS", 5000);
690 // Number of different background levels for background processes.  We use
691 // these different levels to force the low-memory killer to kill processes in
692 // a LRU order.
693 pref("dom.ipc.processPriorityManager.backgroundLRUPoolLevels", 5);
695 // Kernel parameters for process priorities.  These affect how processes are
696 // killed on low-memory and their relative CPU priorities.
698 // Note: The maximum nice value on Linux is 19, but the max value you should
699 // use here is 18.  NSPR adds 1 to some threads' nice values, to mark
700 // low-priority threads.  If the process priority manager were to renice a
701 // process (and all its threads) to 19, all threads would have the same
702 // niceness.  Then when we reniced the process to (say) 10, all threads would
703 // /still/ have the same niceness; we'd effectively have erased NSPR's thread
704 // priorities.
706 // The kernel can only accept 6 (OomScoreAdjust, KillUnderKB) pairs. But it is
707 // okay, kernel will still kill processes with larger OomScoreAdjust first even
708 // its OomScoreAdjust don't have a corresponding KillUnderKB.
710 pref("hal.processPriorityManager.gonk.MASTER.OomScoreAdjust", 0);
711 pref("hal.processPriorityManager.gonk.MASTER.KillUnderKB", 4096);
712 pref("hal.processPriorityManager.gonk.MASTER.Nice", 0);
714 pref("hal.processPriorityManager.gonk.PREALLOC.OomScoreAdjust", 67);
715 pref("hal.processPriorityManager.gonk.PREALLOC.Nice", 18);
717 pref("hal.processPriorityManager.gonk.FOREGROUND_HIGH.OomScoreAdjust", 67);
718 pref("hal.processPriorityManager.gonk.FOREGROUND_HIGH.KillUnderKB", 5120);
719 pref("hal.processPriorityManager.gonk.FOREGROUND_HIGH.Nice", 0);
721 pref("hal.processPriorityManager.gonk.FOREGROUND.OomScoreAdjust", 134);
722 pref("hal.processPriorityManager.gonk.FOREGROUND.KillUnderKB", 6144);
723 pref("hal.processPriorityManager.gonk.FOREGROUND.Nice", 1);
725 pref("hal.processPriorityManager.gonk.FOREGROUND_KEYBOARD.OomScoreAdjust", 200);
726 pref("hal.processPriorityManager.gonk.FOREGROUND_KEYBOARD.Nice", 1);
728 pref("hal.processPriorityManager.gonk.BACKGROUND_PERCEIVABLE.OomScoreAdjust", 400);
729 pref("hal.processPriorityManager.gonk.BACKGROUND_PERCEIVABLE.KillUnderKB", 7168);
730 pref("hal.processPriorityManager.gonk.BACKGROUND_PERCEIVABLE.Nice", 7);
732 pref("hal.processPriorityManager.gonk.BACKGROUND_HOMESCREEN.OomScoreAdjust", 534);
733 pref("hal.processPriorityManager.gonk.BACKGROUND_HOMESCREEN.KillUnderKB", 8192);
734 pref("hal.processPriorityManager.gonk.BACKGROUND_HOMESCREEN.Nice", 18);
736 pref("hal.processPriorityManager.gonk.BACKGROUND.OomScoreAdjust", 667);
737 pref("hal.processPriorityManager.gonk.BACKGROUND.KillUnderKB", 20480);
738 pref("hal.processPriorityManager.gonk.BACKGROUND.Nice", 18);
740 // Processes get this niceness when they have low CPU priority.
741 pref("hal.processPriorityManager.gonk.LowCPUNice", 18);
743 // By default the compositor thread on gonk runs without real-time priority.  RT
744 // priority can be enabled by setting this pref to a value between 1 and 99.
745 // Note that audio processing currently runs at RT priority 2 or 3 at most.
747 // If RT priority is disabled, then the compositor nice value is used.  The
748 // code will default to ANDROID_PRIORITY_URGENT_DISPLAY which is -8.  Per gfx
749 // request we are keeping the compositor at nice level 0 until we can complete
750 // the investigation in bug 982972.
752 // Do not change these values without gfx team review.
753 pref("hal.gonk.COMPOSITOR.rt_priority", 0);
754 pref("hal.gonk.COMPOSITOR.nice", -4);
756 // Fire a memory pressure event when the system has less than Xmb of memory
757 // remaining.  You should probably set this just above Y.KillUnderKB for
758 // the highest priority class Y that you want to make an effort to keep alive.
759 // (For example, we want BACKGROUND_PERCEIVABLE to stay alive.)  If you set
760 // this too high, then we'll send out a memory pressure event every Z seconds
761 // (see below), even while we have processes that we would happily kill in
762 // order to free up memory.
763 pref("hal.processPriorityManager.gonk.notifyLowMemUnderKB", 14336);
765 // We wait this long before polling the memory-pressure fd after seeing one
766 // memory pressure event.  (When we're not under memory pressure, we sit
767 // blocked on a poll(), and this pref has no effect.)
768 pref("gonk.systemMemoryPressureRecoveryPollMS", 5000);
770 #ifndef DEBUG
771 // Enable pre-launching content processes for improved startup time
772 // (hiding latency).
773 pref("dom.ipc.processPrelaunch.enabled", true);
774 // Wait this long before pre-launching a new subprocess.
775 pref("dom.ipc.processPrelaunch.delayMs", 5000);
776 #endif
778 pref("dom.ipc.reuse_parent_app", false);
780 // When a process receives a system message, we hold a CPU wake lock on its
781 // behalf for this many seconds, or until it handles the system message,
782 // whichever comes first.
783 pref("dom.ipc.systemMessageCPULockTimeoutSec", 30);
785 // Ignore the "dialog=1" feature in window.open.
786 pref("dom.disable_window_open_dialog_feature", true);
788 // Screen reader support
789 pref("accessibility.accessfu.activate", 2);
790 pref("accessibility.accessfu.quicknav_modes", "Link,Heading,FormElement,Landmark,ListItem");
791 // Setting for an utterance order (0 - description first, 1 - description last).
792 pref("accessibility.accessfu.utterance", 1);
793 // Whether to skip images with empty alt text
794 pref("accessibility.accessfu.skip_empty_images", true);
796 // Enable hit-target fluffing
797 pref("ui.touch.radius.enabled", true);
798 pref("ui.touch.radius.leftmm", 3);
799 pref("ui.touch.radius.topmm", 5);
800 pref("ui.touch.radius.rightmm", 3);
801 pref("ui.touch.radius.bottommm", 2);
803 pref("ui.mouse.radius.enabled", true);
804 pref("ui.mouse.radius.leftmm", 3);
805 pref("ui.mouse.radius.topmm", 5);
806 pref("ui.mouse.radius.rightmm", 3);
807 pref("ui.mouse.radius.bottommm", 2);
809 // Disable native prompt
810 pref("browser.prompt.allowNative", false);
812 // Minimum delay in milliseconds between network activity notifications (0 means
813 // no notifications). The delay is the same for both download and upload, though
814 // they are handled separately. This pref is only read once at startup:
815 // a restart is required to enable a new value.
816 pref("network.activity.blipIntervalMilliseconds", 250);
818 // By default we want the NetworkManager service to manage Gecko's offline
819 // status for us according to the state of Wifi/cellular data connections.
820 // In some environments, such as the emulator or hardware with other network
821 // connectivity, this is not desireable, however, in which case this pref
822 // can be flipped to false.
823 pref("network.gonk.manage-offline-status", true);
825 // On Firefox Mulet, we can't enable shared JSM scope
826 // as it breaks most Firefox JSMs (see bug 961777)
827 #ifndef MOZ_MULET
828 pref("jsloader.reuseGlobal", true);
829 #endif
831 // Enable font inflation for browser tab content.
832 pref("font.size.inflation.minTwips", 120);
833 // And disable it for lingering master-process UI.
834 pref("font.size.inflation.disabledInMasterProcess", true);
836 // Enable freeing dirty pages when minimizing memory; this reduces memory
837 // consumption when applications are sent to the background.
838 pref("memory.free_dirty_pages", true);
840 // Enable the Linux-specific, system-wide memory reporter.
841 pref("memory.system_memory_reporter", true);
843 // Don't dump memory reports on OOM, by default.
844 pref("memory.dump_reports_on_oom", false);
846 pref("layout.imagevisibility.enabled", true);
847 pref("layout.imagevisibility.numscrollportwidths", 1);
848 pref("layout.imagevisibility.numscrollportheights", 1);
850 // Enable native identity (persona/browserid)
851 pref("dom.identity.enabled", true);
853 // Wait up to this much milliseconds when orientation changed
854 pref("layers.orientation.sync.timeout", 1000);
856 // Don't discard WebGL contexts for foreground apps on memory
857 // pressure.
858 pref("webgl.can-lose-context-in-foreground", false);
860 // Allow nsMemoryInfoDumper to create a fifo in the temp directory.  We use
861 // this fifo to trigger about:memory dumps, among other things.
862 pref("memory_info_dumper.watch_fifo.enabled", true);
863 pref("memory_info_dumper.watch_fifo.directory", "/data/local");
865 // See ua-update.json.in for the packaged UA override list
866 pref("general.useragent.updates.enabled", true);
867 pref("general.useragent.updates.url", "https://dynamicua.cdn.mozilla.net/0/%APP_ID%");
868 pref("general.useragent.updates.interval", 604800); // 1 week
869 pref("general.useragent.updates.retry", 86400); // 1 day
871 // Make <audio> and <video> talk to the AudioChannelService.
872 pref("media.useAudioChannelService", true);
874 pref("b2g.version", @MOZ_B2G_VERSION@);
875 pref("b2g.osName", @MOZ_B2G_OS_NAME@);
877 // Disable console buffering to save memory.
878 pref("consoleservice.buffered", false);
880 #ifdef MOZ_WIDGET_GONK
881 // Performance testing suggests 2k is a better page size for SQLite.
882 pref("toolkit.storage.pageSize", 2048);
883 #endif
885 // Enable captive portal detection.
886 pref("captivedetect.canonicalURL", "http://detectportal.firefox.com/success.txt");
887 pref("captivedetect.canonicalContent", "success\n");
889 // The url of the manifest we use for ADU pings.
890 pref("ping.manifestURL", "https://marketplace.firefox.com/packaged.webapp");
892 // Enable the disk space watcher
893 pref("disk_space_watcher.enabled", true);
895 // SNTP preferences.
896 pref("network.sntp.maxRetryCount", 10);
897 pref("network.sntp.refreshPeriod", 86400); // In seconds.
898 pref("network.sntp.pools", // Servers separated by ';'.
899      "0.pool.ntp.org;1.pool.ntp.org;2.pool.ntp.org;3.pool.ntp.org");
900 pref("network.sntp.port", 123);
901 pref("network.sntp.timeout", 30); // In seconds.
903 // Enable dataStore
904 pref("dom.datastore.enabled", true);
905 // When an entry is changed, use two timers to fire system messages in a more
906 // moderate pattern.
907 pref("dom.datastore.sysMsgOnChangeShortTimeoutSec", 10);
908 pref("dom.datastore.sysMsgOnChangeLongTimeoutSec", 60);
910 // DOM Inter-App Communication API.
911 pref("dom.inter-app-communication-api.enabled", true);
913 // Allow ADB to run for this many hours before disabling
914 // (only applies when marionette is disabled)
915 // 0 disables the timer.
916 pref("b2g.adb.timeout-hours", 12);
918 // InputMethod so we can do soft keyboards
919 pref("dom.mozInputMethod.enabled", true);
921 // Absolute path to the devtool unix domain socket file used
922 // to communicate with a usb cable via adb forward
923 pref("devtools.debugger.unix-domain-socket", "/data/local/debugger-socket");
925 // enable Skia/GL (OpenGL-accelerated 2D drawing) for large enough 2d canvases,
926 // falling back to Skia/software for smaller canvases
927 #ifdef MOZ_WIDGET_GONK
928 pref("gfx.canvas.azure.backends", "skia");
929 pref("gfx.canvas.azure.accelerated", true);
930 #endif
932 // Turn on dynamic cache size for Skia
933 pref("gfx.canvas.skiagl.dynamic-cache", true);
935 // Limit skia to canvases the size of the device screen or smaller
936 pref("gfx.canvas.max-size-for-skia-gl", -1);
938 // enable fence with readpixels for SurfaceStream
939 pref("gfx.gralloc.fence-with-readpixels", true);
941 // The url of the page used to display network error details.
942 pref("b2g.neterror.url", "app://system.gaiamobile.org/net_error.html");
944 // The origin used for the shared themes uri space.
945 pref("b2g.theme.origin", "app://theme.gaiamobile.org");
946 pref("dom.mozApps.themable", true);
947 pref("dom.mozApps.selected_theme", "default_theme.gaiamobile.org");
949 // Enable Web Speech synthesis API
950 pref("media.webspeech.synth.enabled", true);
952 // Downloads API
953 pref("dom.mozDownloads.enabled", true);
954 pref("dom.downloads.max_retention_days", 7);
956 // External Helper Application Handling
958 // All external helper application handling can require the docshell to be
959 // active before allowing the external helper app service to handle content.
961 // To prevent SD card DoS attacks via downloads we disable background handling.
963 pref("security.exthelperapp.disable_background_handling", true);
965 // Inactivity time in milliseconds after which we shut down the OS.File worker.
966 pref("osfile.reset_worker_delay", 5000);
968 // APZC preferences.
970 // Gaia relies heavily on scroll events for now, so lets fire them
971 // more often than the default value (100).
972 pref("apz.asyncscroll.throttle", 40);
973 pref("apz.pan_repaint_interval", 16);
975 // APZ physics settings, tuned by UX designers
976 pref("apz.max_velocity_inches_per_ms", "0.07");
977 pref("apz.fling_friction", "0.003");
979 // Tweak default displayport values to reduce the risk of running out of
980 // memory when zooming in
981 pref("apz.x_skate_size_multiplier", "1.25");
982 pref("apz.y_skate_size_multiplier", "1.5");
983 pref("apz.x_stationary_size_multiplier", "1.5");
984 pref("apz.y_stationary_size_multiplier", "1.8");
985 pref("apz.enlarge_displayport_when_clipped", true);
986 // Use "sticky" axis locking
987 pref("apz.axis_lock_mode", 2);
988 pref("apz.subframe.enabled", true);
990 // Overscroll-related settings
991 pref("apz.overscroll.enabled", true);
992 pref("apz.overscroll.fling_friction", "0.05");
993 pref("apz.overscroll.fling_stopped_threshold", "0.4");
994 pref("apz.overscroll.stretch_factor", "0.5");
995 pref("apz.overscroll.snap_back.spring_stiffness", "0.05");
996 pref("apz.overscroll.snap_back.spring_friction", "0.1");
997 pref("apz.overscroll.snap_back.mass", "100");
999 // This preference allows FirefoxOS apps (and content, I think) to force
1000 // the use of software (instead of hardware accelerated) 2D canvases by
1001 // creating a context like this:
1003 //   canvas.getContext('2d', { willReadFrequently: true })
1005 // Using a software canvas can save memory when JS calls getImageData()
1006 // on the canvas frequently. See bug 884226.
1007 pref("gfx.canvas.willReadFrequently.enable", true);
1009 // Disable autofocus until we can have it not bring up the keyboard.
1010 // https://bugzilla.mozilla.org/show_bug.cgi?id=965763
1011 pref("browser.autofocus", false);
1013 // Enable wakelock
1014 pref("dom.wakelock.enabled", true);
1016 // Disable touch caret by default
1017 pref("touchcaret.enabled", false);
1019 // Disable selection caret by default
1020 pref("selectioncaret.enabled", false);
1022 // Enable sync and mozId with Firefox Accounts.
1023 pref("services.sync.fxaccounts.enabled", true);
1024 pref("identity.fxaccounts.enabled", true);
1026 // Mobile Identity API.
1027 pref("services.mobileid.server.uri", "https://msisdn.services.mozilla.com");
1029 // Enable mapped array buffer.
1030 #ifndef XP_WIN
1031 pref("dom.mapped_arraybuffer.enabled", true);
1032 #endif
1034 // UDPSocket API
1035 pref("dom.udpsocket.enabled", true);
1037 pref("dom.mozSettings.SettingsDB.debug.enabled", true);
1038 pref("dom.mozSettings.SettingsManager.debug.enabled", true);
1039 pref("dom.mozSettings.SettingsRequestManager.debug.enabled", true);
1040 pref("dom.mozSettings.SettingsService.debug.enabled", true);
1042 pref("dom.mozSettings.SettingsDB.verbose.enabled", false);
1043 pref("dom.mozSettings.SettingsManager.verbose.enabled", false);
1044 pref("dom.mozSettings.SettingsRequestManager.verbose.enabled", false);
1045 pref("dom.mozSettings.SettingsService.verbose.enabled", false);