tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

geckoview-prefs.js (16590B)


      1 #filter dumbComments emptyLines substitution
      2 
      3 // This Source Code Form is subject to the terms of the Mozilla Public
      4 // License, v. 2.0. If a copy of the MPL was not distributed with this
      5 // file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 // Non-static prefs that are specific to GeckoView belong in this file.
      8 //
      9 // Please indent all prefs defined within #ifdef/#ifndef conditions. This
     10 // improves readability, particular for conditional blocks that exceed a single
     11 // screen.
     12 
     13 pref("accessibility.typeaheadfind", false);
     14 pref("accessibility.typeaheadfind.flashBar", 1);
     15 pref("accessibility.typeaheadfind.linksonly", false);
     16 pref("accessibility.typeaheadfind.timeout", 5000);
     17 
     18 pref("app.support.baseURL", "https://support.mozilla.org/1/mobile/%VERSION%/%OS%/%LOCALE%/");
     19 
     20 // Prefs used by UpdateTimerManager (including blocklist pings) (bug 783909)
     21 pref("app.update.timerFirstInterval", 30000); // milliseconds
     22 pref("app.update.timerMinimumDelay", 30); // seconds
     23 
     24 // Use a breakout angle of 30° (bug 1885506)
     25 pref("apz.axis_lock.breakout_angle", "0.5235988");
     26 
     27 // APZ content response timeout (bug 1247280)
     28 pref("apz.content_response_timeout", 600);
     29 
     30 // Disable scrollbar dragging on Android (bug 1339831)
     31 pref("apz.drag.enabled", false);
     32 
     33 // Tweak fling curving to make medium-length flings go a bit faster (bug 1243854)
     34 pref("apz.fling_curve_function_x1", "0.59");
     35 pref("apz.fling_curve_function_x2", "0.05");
     36 pref("apz.fling_curve_function_y1", "0.46");
     37 pref("apz.fling_curve_function_y2", "1.00");
     38 
     39 // :gordonb from UX said this value makes fling curving
     40 // feel a lot better (bug 1095727)
     41 pref("apz.fling_curve_threshold_inches_per_ms", "0.01");
     42 
     43 // Adjust fling physics based on UX feedback (bug 1229839)
     44 pref("apz.fling_friction", "0.004");
     45 
     46 // Use Android OverScroller class for fling animation (bug 1229462)
     47 pref("apz.fling_stopped_threshold", "0.0");
     48 
     49 // :gordonb from UX said this value makes fling curving
     50 // feel a lot better (bug 1095727)
     51 pref("apz.max_velocity_inches_per_ms", "0.07");
     52 
     53 // Don't allow a faraway second tap to start a one-touch pinch gesture (bug 1391770)
     54 pref("apz.second_tap_tolerance", "0.3");
     55 
     56 // This value originates from bug 1174532
     57 pref("apz.touch_move_tolerance", "0.03");
     58 
     59 // Lower the touch-start tolerance threshold to reduce scroll lag with APZ (bug 1230077)
     60 pref("apz.touch_start_tolerance", "0.06");
     61 
     62 // The breakpad report server to link to in about:crashes
     63 pref("breakpad.reportURL", "https://crash-stats.mozilla.org/report/index/");
     64 
     65 // Prevent tooltips from showing up (bug 623063)
     66 pref("browser.chrome.toolbar_tips", false);
     67 
     68 // True if you always want dump() to work
     69 //
     70 // On Android, you also need to do the following for the output
     71 // to show up in logcat:
     72 //
     73 // $ adb shell stop
     74 // $ adb shell setprop log.redirect-stdio true
     75 // $ adb shell start
     76 pref("browser.dom.window.dump.enabled", true);
     77 
     78 // Default to ~/Downloads (bug 437954)
     79 pref("browser.download.folderList", 1);
     80 
     81 // Use Android DownloadManager for scanning downloads (bug 816318)
     82 pref("browser.download.manager.addToRecentDocs", true);
     83 
     84 // Load PDF files inline with PDF.js (bug 1754499)
     85 pref("browser.download.open_pdf_attachments_inline", true);
     86 
     87 pref("browser.download.useDownloadDir", true);
     88 
     89 // When enabled, Services.uriFixup.isDomainKnown('localhost') will return true
     90 pref("browser.fixup.domainwhitelist.localhost", true);
     91 
     92 // Open in tab preferences
     93 pref("browser.link.open_newwindow", 3);
     94 
     95 // Supported values:
     96 //  - 0: Force all new windows to tabs
     97 //  - 1: Don't force
     98 //  - 2: Only force those with no features set
     99 pref("browser.link.open_newwindow.restriction", 0);
    100 
    101 // Don't allow meta-refresh when backgrounded (bug 518805)
    102 pref("browser.meta_refresh_when_inactive.disabled", true);
    103 
    104 // The download protection UI is not implemented yet (bug 1239094).
    105 pref("browser.safebrowsing.downloads.enabled", false);
    106 
    107 pref("browser.safebrowsing.features.harmfuladdon.update", true);
    108 pref("browser.safebrowsing.features.cryptomining.update", true);
    109 pref("browser.safebrowsing.features.fingerprinting.update", true);
    110 pref("browser.safebrowsing.features.malware.update", true);
    111 pref("browser.safebrowsing.features.phishing.update", true);
    112 pref("browser.safebrowsing.features.trackingAnnotation.update", true);
    113 pref("browser.safebrowsing.features.trackingProtection.update", true);
    114 
    115 // Disable search suggestions by default (bug 784104)
    116 pref("browser.search.suggest.enabled", false);
    117 
    118 // Disable search engine updating (bug 431842)
    119 pref("browser.search.update", false);
    120 
    121 // Session history
    122 pref("browser.sessionhistory.contentViewerTimeout", 360);
    123 pref("browser.sessionhistory.max_entries", 50);
    124 
    125 // Session store
    126 pref("browser.sessionstore.interval", 10000); // milliseconds
    127 pref("browser.sessionstore.max_resumed_crashes", 2);
    128 pref("browser.sessionstore.max_tabs_undo", 10);
    129 // Supported values:
    130 //  - 0: all
    131 //  - 1: unencrypted sites
    132 //  - 2: never
    133 pref("browser.sessionstore.privacy_level", 0);
    134 pref("browser.sessionstore.resume_from_crash", true);
    135 
    136 // Enables the translations engine
    137 pref("browser.translations.enable", true);
    138 // Used for mocking data for GeckoView Translations tests, should use in addition with an automation check.
    139 pref("browser.translations.geckoview.enableAllTestMocks", false);
    140 
    141 // Used for mocking data for GeckoView WebCompat tests, should use in addition with an automation check.
    142 pref("browser.webcompat.geckoview.enableAllTestMocks", false);
    143 
    144 // SSL error page behaviour (bug 437372)
    145 pref("browser.xul.error_pages.expert_bad_cert", false);
    146 
    147 // Enable sparse localization by setting a few package locale overrides (bug 792077)
    148 pref("chrome.override_package.global", "browser");
    149 pref("chrome.override_package.mozapps", "browser");
    150 pref("chrome.override_package.passwordmgr", "browser");
    151 
    152 // Allow Console API to log messages on stdout (bug 1480544)
    153 pref("devtools.console.stdout.chrome", true);
    154 
    155 // Enable capture attribute for file input (bug 1553603)
    156 pref("dom.capture.enabled", true);
    157 
    158 // Block popups by default (bug 436057)
    159 pref("dom.disable_open_during_load", true);
    160 
    161 // Don't allow JS to move and resize existing windows (bug 456081)
    162 pref("dom.disable_window_move_resize", true);
    163 
    164 // "graceful" process termination is misinterpreted as a process crash.
    165 // To avoid this issue, we set dom.ipc.keepProcessesAlive.extension to 1.
    166 // This stops Gecko from terminating the extension process. This also reduces
    167 // the overhead of resuming a suspended (background) extension page.
    168 // Note that this only covers "graceful" termination by Gecko.
    169 // Android-triggered force-kills and OOM are not prevented and should still
    170 // be accounted for. See bug 1847608 for more info
    171 pref("dom.ipc.keepProcessesAlive.extension", 1);
    172 
    173 // Keep empty content process alive on Android (bug 1447393)
    174 pref("dom.ipc.keepProcessesAlive.web", 1);
    175 
    176 // Enable the preallocated process on Android
    177 pref("dom.ipc.processPrelaunch.enabled", true);
    178 
    179 // Increase script timeouts (bug 485610)
    180 pref("dom.max_script_run_time", 20);
    181 
    182 // Enable meta-viewport support for font inflation code (bug 1106255)
    183 pref("dom.meta-viewport.enabled", true);
    184 
    185 // The maximum number of recent message IDs to store for each push
    186 // subscription, to avoid duplicates for unacknowledged messages (bug 1207743)
    187 pref("dom.push.maxRecentMessageIDsPerSubscription", 0);
    188 
    189 // Enable WebShare support (bug 1402369)
    190 pref("dom.webshare.enabled", true);
    191 
    192 // Disable add-ons that are not installed by the user in all scopes by default (See the SCOPE
    193 // constants in AddonManager.sys.mjs for values to use here, and Bug 1405528 for a rationale)
    194 pref("extensions.autoDisableScopes", 15);
    195 
    196 pref("extensions.enabledScopes", 5);
    197 
    198 // If true, unprivileged extensions may use experimental APIs
    199 pref("extensions.experiments.enabled", false);
    200 
    201 // Support credit cards in GV autocomplete API (bug 1691819)
    202 pref("extensions.formautofill.addresses.capture.enabled", true);
    203 
    204 pref("extensions.getAddons.browseAddons", "https://addons.mozilla.org/%LOCALE%/android/collections/4757633/mob/?page=1&collection_sort=-popularity");
    205 pref("extensions.getAddons.cache.enabled", true);
    206 pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/api/v4/addons/search/?guid=%IDS%&lang=%LOCALE%");
    207 pref("extensions.getAddons.langpacks.url", "https://services.addons.mozilla.org/api/v4/addons/language-tools/?app=android&type=language&appversion=%VERSION%");
    208 pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/android/search?q=%TERMS%&platform=%OS%&appver=%VERSION%");
    209 
    210 // Don't let XPIProvider install distribution add-ons; we do our own thing on mobile
    211 pref("extensions.installDistroAddons", false);
    212 
    213 // Require language packs to be signed (bug 1454141)
    214 pref("extensions.langpacks.signatures.required", true);
    215 
    216 // Enables some extra Extension System Logging (can reduce performance)
    217 pref("extensions.logging.enabled", false);
    218 
    219 // Whether MV3 restrictions for actions popup urls should be extended to MV2 extensions
    220 // (only allowing same extension urls to be used as action popup urls)
    221 pref("extensions.manifestV2.actionsPopupURLRestricted", true);
    222 
    223 // Disables strict compatibility, making addons compatible-by-default
    224 pref("extensions.strictCompatibility", false);
    225 
    226 // Allow system add-on updates (bug 1260213)
    227 pref("extensions.systemAddon.update.enabled", true);
    228 pref("extensions.systemAddon.update.url", "https://aus5.mozilla.org/update/3/SystemAddons/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
    229 
    230 // Enable the EnvironmentAddonBuilder collecting the Glean
    231 // activeAddons/theme/GMPlugins metrics.
    232 pref("extensions.telemetry.EnvironmentAddonBuilder", true);
    233 
    234 pref("extensions.update.background.url", "https://versioncheck-bg.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%");
    235 pref("extensions.update.enabled", true);
    236 pref("extensions.update.interval", 86400);
    237 pref("extensions.update.url", "https://versioncheck.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%");
    238 
    239 // Enable prompts for browser.permissions.request() (bug 1392176)
    240 pref("extensions.webextOptionalPermissionPrompts", true);
    241 
    242 // Start (proxy) extensions as soon as a network request is observed, instead
    243 // of waiting until the first browser window has opened. This is needed because
    244 // GeckoView can trigger requests without opening geckoview.xhtml.
    245 pref("extensions.webextensions.early_background_wakeup_on_request", true);
    246 
    247 // Enable data collection permissions.
    248 pref("extensions.dataCollectionPermissions.enabled", true);
    249 
    250 // Scroll and zoom into editable form fields (bug 834613)
    251 pref("formhelper.autozoom", true);
    252 
    253 // Optionally send web console output to logcat (bug 1415318)
    254 pref("geckoview.console.enabled", false);
    255 
    256 pref("image.cache.size", 1048576); // bytes
    257 
    258 // Inherit locale from the OS, used for multi-locale builds
    259 pref("intl.locale.requested", "");
    260 
    261 // Always tilt the caret to match the text selection guideline (bug 1097398)
    262 pref("layout.accessiblecaret.always_tilt", true);
    263 
    264 // Show the caret when long tapping on empty content (bug 1246064)
    265 pref("layout.accessiblecaret.caret_shown_when_long_tapping_on_empty_content", true);
    266 
    267 // Initial text selection on long-press is enhanced to provide
    268 // a smarter phone-number selection for direct-dial ActionBar action (bug 1235508)
    269 pref("layout.accessiblecaret.extend_selection_for_phone_number", true);
    270 
    271 // Provide haptic feedback on longPress selection events (bug 1230613)
    272 pref("layout.accessiblecaret.hapticfeedback", true);
    273 
    274 // AccessibleCaret css for Android L style assets (bug 1097398)
    275 pref("layout.accessiblecaret.height", "22.0");
    276 pref("layout.accessiblecaret.margin-left", "-11.5");
    277 pref("layout.accessiblecaret.width", "22.0");
    278 
    279 // Update any visible carets for selection changes due to JS calls,
    280 // but don't show carets if carets are hidden (bug 1463576)
    281 pref("layout.accessiblecaret.script_change_update_mode", 1);
    282 
    283 // Disable CSS error reporting by default to improve performance (bug 831123)
    284 pref("layout.css.report_errors", false);
    285 
    286 pref("layout.spellcheckDefault", 0);
    287 
    288 // Enable EME permission prompts (bug 1620102)
    289 pref("media.eme.require-app-approval", true);
    290 
    291 // Enable autoplay permission prompts (bug 1577596)
    292 pref("media.geckoview.autoplay.request", true);
    293 
    294 // Enable Widevine MediaKeySystem (bug 1306219)
    295 pref("media.mediadrm-widevinecdm.visible", true);
    296 
    297 // Ask for permission when enumerating WebRTC devices (bug 1369108)
    298 pref("media.navigator.permission.device", true);
    299 
    300 // On mobile we throttle the download once the readahead_limit is hit
    301 // if we're using a cellular connection, even if the download is slow,
    302 // this is to preserve battery and data (bug 1540573)
    303 pref("media.throttle-cellular-regardless-of-download-rate", true);
    304 
    305 // Increase necko buffer sizes for Android (bug 560591)
    306 pref("network.buffer.cache.size",  16384);
    307 
    308 // Set HPACK receive buffer size appropriately for Android (bug 1296280)
    309 pref("network.http.http2.default-hpack-buffer", 4096);
    310 
    311 // HTTP/2 Server Push (bug 790388)
    312 pref("network.http.http2.push-allowance", 32768);
    313 
    314 // Reduce HTTP Idle connection timeout on Android to improve battery life (bug 1007959)
    315 pref("network.http.keep-alive.timeout", 109);
    316 
    317 // Update connection limits; especially for proxies (bug 648603)
    318 pref("network.http.max-persistent-connections-per-proxy", 20);
    319 
    320 // Disable warning for mailto and tel protocols (bug 589403)
    321 pref("network.protocol-handler.warn-external.mailto", false);
    322 pref("network.protocol-handler.warn-external.tel", false);
    323 
    324 // Disable warning for sms protocol (bug 819554)
    325 pref("network.protocol-handler.warn-external.sms", false);
    326 
    327 // Do not warn when opening YouTube (bug 630364)
    328 pref("network.protocol-handler.warn-external.vnd.youtube", false);
    329 
    330 // Transmit UDP busy-work to the LAN when anticipating low latency
    331 // network reads and on wifi to mitigate 802.11 Power Save Polling delays
    332 // (bug 888268)
    333 pref("network.tickle-wifi.enabled", true);
    334 
    335 // Controls OHTTP config URL
    336 pref("network.ohttp.configURL", "https://prod.ohttp-gateway.prod.webservices.mozgcp.net/ohttp-configs");
    337 
    338 // Controls OHTTP relay URL
    339 pref("network.ohttp.relayURL", "https://mozilla-ohttp.fastly-edge.com/");
    340 
    341 // Complete the page load progress bar at different places according to this pref.
    342 // See the possible values below:
    343 // 0 no change
    344 // 1 complete progressbar at DOMContentLoaded
    345 // 2 complete progressbar at first MozAfterPaint after DOMContentLoaded
    346 pref("page_load.progressbar_completion", 2);
    347 
    348 // Try to convert PDFs sent as octet-stream (bug 1754499)
    349 pref("pdfjs.handleOctetStream", true);
    350 
    351 // Disable tracking protection in PBM for GeckoView (bug 1436887)
    352 pref("privacy.trackingprotection.pbmode.enabled", false);
    353 
    354 // Relay integration is not supported on mobile
    355 pref("signon.firefoxRelay.feature", "not available");
    356 
    357 pref("signon.showAutoCompleteFooter", true);
    358 
    359 // Locked because any other value would break GeckoView
    360 pref("toolkit.defaultChromeURI", "chrome://geckoview/content/geckoview.xhtml", locked);
    361 
    362 // Whether to use unified telemetry behavior; requires a restart to take effect
    363 pref("toolkit.telemetry.unified", false);
    364 
    365 // Download protection lists are not available on Android (bug 1397938, bug 1394017)
    366 pref("urlclassifier.downloadAllowTable", "");
    367 pref("urlclassifier.downloadBlockTable", "");
    368 
    369 // Delay the CRC32 check for URLClassifier to improve applink performance. (bug 1956920, bug 1971949)
    370 pref("urlclassifier.delay_prefixes_crc32_check", true);
    371 
    372 // The Potentially Harmful Apps list replaces the malware one on Android (bug 1394017)
    373 pref("urlclassifier.malwareTable", "goog-harmful-proto,goog-unwanted-proto,moztest-harmful-simple,moztest-malware-simple,moztest-unwanted-simple");
    374 
    375 // Android doesn't support the new sync storage yet (bug 1625257)
    376 pref("webextensions.storage.sync.kinto", true);
    377 
    378 // Require extensions to be signed (bug 1244329)
    379 pref("xpinstall.signatures.required", true);
    380 
    381 pref("xpinstall.whitelist.add", "https://addons.mozilla.org");
    382 pref("xpinstall.whitelist.fileRequest", false);
    383 
    384 #include 000-tor-browser-android.js