commit 8cfb90c7f21a220378adaaa8f5f54ce0e9cccb39 Author: Richard Pospesel richard@torproject.org Date: Tue Jun 26 11:06:57 2018 -0700
Bug 26039: FIXUP <profiledir>/preferences/extension-overrides.js will not be loaded in ESR 60
Fixup for 26039. WebExtension extensions can't read/write prefs, so the base contents of extension-overrides.js are completely unnecessary. The WebExtension versions of noscript and httpseverywhere seem to be nearly complete re-writes (noscript in particular is much simpler) so our custom options appear to be no longer required (though a complete audit of noscript should probably be done just to be sure we don't need to fix any bad behaviour).
The updated build script for tor-browser now dumps all of the build-determined prefs (pluggable transport strings, localization options) into a generated-prefs.js file created at build time, which is then appended to 000-tor-browser.js as before.
The pdfjs option is no longer needed since the disableRange option seems to break pdfjs altogether in latest ESR60. Also, setting the user pref in 000-tor-browser.js does not work since pdfjs overwrites it with its own value (any future patch setting pdfjs options needs to modify the default values table) --- .../Bundle-Data/PTConfigs/extension-overrides.js | 63 ---------------------- projects/tor-browser/build | 16 +++--- 2 files changed, 9 insertions(+), 70 deletions(-)
diff --git a/projects/tor-browser/Bundle-Data/PTConfigs/extension-overrides.js b/projects/tor-browser/Bundle-Data/PTConfigs/extension-overrides.js deleted file mode 100644 index c81a7bf..0000000 --- a/projects/tor-browser/Bundle-Data/PTConfigs/extension-overrides.js +++ /dev/null @@ -1,63 +0,0 @@ -# Overrides for Extension Preferences -# Tor Browser Bundle -# Do not edit this file. - -# HTTPS Everywhere Preferences: -pref("extensions.https_everywhere._observatory.popup_shown", true); -pref("extensions.https_everywhere.toolbar_hint_shown", true); - -# NoScript Preferences: -pref("capability.policy.maonoscript.javascript.enabled", "allAccess"); -pref("capability.policy.maonoscript.sites", "[System+Principal] about: about:tbupdate about:tor chrome: resource: blob: mediasource: moz-extension: moz-safe-about: about:neterror about:certerror about:feeds about:tabcrashed about:cache"); -pref("noscript.default", "[System+Principal] about: about:tbupdate about:tor chrome: resource: blob: mediasource: moz-extension: moz-safe-about: about:neterror about:certerror about:feeds about:tabcrashed about:cache"); -pref("noscript.mandatory", "[System+Principal] about: about:tbupdate about:tor chrome: resource: blob: mediasource: moz-extension: moz-safe-about: about:neterror about:certerror about:feeds about:tabcrashed about:cache"); -pref("noscript.ABE.enabled", false); -pref("noscript.ABE.notify", false); -pref("noscript.ABE.wanIpAsLocal", false); -pref("noscript.confirmUnblock", false); -pref("noscript.contentBlocker", true); -pref("noscript.firstRunRedirection", false); -pref("noscript.global", true); -pref("noscript.gtemp", ""); -pref("noscript.opacizeObject", 3); -pref("noscript.forbidWebGL", true); -pref("noscript.forbidFonts", false); -pref("noscript.options.tabSelectedIndexes", "5,0,0"); -pref("noscript.policynames", ""); -pref("noscript.secureCookies", true); -pref("noscript.showAllowPage", false); -pref("noscript.showBaseDomain", false); -pref("noscript.showDistrust", false); -pref("noscript.showRecentlyBlocked", false); -pref("noscript.showTemp", false); -pref("noscript.showTempToPerm", false); -pref("noscript.showUntrusted", false); -pref("noscript.STS.enabled", false); -pref("noscript.subscription.lastCheck", -142148139); -pref("noscript.temp", ""); -pref("noscript.untrusted", ""); -pref("noscript.forbidMedia", false); -pref("noscript.allowWhitelistUpdates", false); -pref("noscript.fixLinks", false); -// Now handled by plugins.click_to_play -pref("noscript.forbidFlash", false); -pref("noscript.forbidSilverlight", false); -pref("noscript.forbidJava", false); -pref("noscript.forbidPlugins", false); -// Usability tweaks -pref("noscript.showPermanent", false); -pref("noscript.showTempAllowPage", true); -pref("noscript.showRevokeTemp", true); -pref("noscript.notify", false); -pref("noscript.autoReload", true); -pref("noscript.autoReload.allTabs", false); -pref("noscript.cascadePermissions", true); -pref("noscript.restrictSubdocScripting", true); -pref("noscript.showVolatilePrivatePermissionsToggle", false); -pref("noscript.volatilePrivatePermissions", true); -pref("noscript.clearClick", 0); - -# PDF.js -// needs to be a user_pref because pdf.js blows away non-user prefs with its own -// defaults each time -user_pref("pdfjs.disableRange", true); diff --git a/projects/tor-browser/build b/projects/tor-browser/build index 50fdc30..5456ad1 100644 --- a/projects/tor-browser/build +++ b/projects/tor-browser/build @@ -12,7 +12,9 @@ mkdir -p $OUTDIR # directory named tor-browser (instead of tor-browser_en-US). Therefore we # stage everything under tor-browser-stage to avoid a conflict. TB_STAGE_DIR=$distdir/tor-browser-stage -EXTOVERRIDESPATH=$rootdir/Bundle-Data/PTConfigs/extension-overrides.js +GENERATEDPREFSPATH=$rootdir/Bundle-Data/PTConfigs/generated-prefs.js +# Create initially empty prefs file where we can dump our conditionally included/genetered prefs +touch "$GENERATEDPREFSPATH"
[% IF c("var/osx") %] TBDIR="$TB_STAGE_DIR/Tor Browser.app" @@ -113,9 +115,9 @@ cat Bundle-Data/PTConfigs/[% bundledata_osname %]/torrc-defaults-appendix >> "$T [% IF c("var/linux") -%] [% IF ! c("var/snowflake") %] grep -v 'default_bridge.snowflake' Bundle-Data/PTConfigs/bridge_prefs.js \ - >> "$EXTOVERRIDESPATH" + >> "$GENERATEDPREFSPATH" [% ELSE %] - cat Bundle-Data/PTConfigs/bridge_prefs.js >> "$EXTOVERRIDESPATH" + cat Bundle-Data/PTConfigs/bridge_prefs.js >> "$GENERATEDPREFSPATH" [% END %] [% END -%] [% IF c("var/windows") -%] @@ -123,13 +125,13 @@ cat Bundle-Data/PTConfigs/[% bundledata_osname %]/torrc-defaults-appendix >> "$T # We don't have fte available on Windows x86_64 yet grep -v 'default_bridge.snowflake' Bundle-Data/PTConfigs/bridge_prefs.js \ [% IF c("var/windows-x86_64") %]| grep -v 'default_bridge.fte' [% END %] \ - >> "$EXTOVERRIDESPATH" + >> "$GENERATEDPREFSPATH" [% END -%] [% IF c("var/osx") -%] # FTE is temporarily removed due to bug 18495. grep -Ev 'default_bridge.fte' Bundle-Data/PTConfigs/bridge_prefs.js \ [% IF ! c("var/snowflake") %]| grep -v 'default_bridge.snowflake' [% END %] \ - >> "$EXTOVERRIDESPATH" + >> "$GENERATEDPREFSPATH" [% END -%] cat Bundle-Data/PTConfigs/meek-http-helper-user.js >> "$TBDIR/$MEEKPROFILEPATH/user.js"
@@ -143,7 +145,7 @@ cat Bundle-Data/PTConfigs/meek-http-helper-user.js >> "$TBDIR/$MEEKPROFILEPATH/u [% END %]
[% IF ! c("var/multi_lingual") %] - echo 'pref("extensions.torlauncher.prompt_for_locale", false);' >> "$EXTOVERRIDESPATH" + echo 'pref("extensions.torlauncher.prompt_for_locale", false);' >> "$GENERATEDPREFSPATH" [% END %]
[% IF c("var/linux") %] @@ -171,7 +173,7 @@ mv chrome/en-US/locale/browser/searchplugins $rootdir rm -rf chrome/en-US unzip omni.ja defaults/preferences/000-tor-browser.js || [ $? -lt 3 ] # Append our built extension-overrides.js to 000-tor-browser.js -cat "$EXTOVERRIDESPATH" >> defaults/preferences/000-tor-browser.js +cat "$GENERATEDPREFSPATH" >> defaults/preferences/000-tor-browser.js cp defaults/preferences/000-tor-browser.js $rootdir [% IF c("var/osx") %] # Embed our default bookmarks within the en-US locale.