Ticket #26039: 0001-Bug-26039-FIXUP-profiledir-preferences-extension-ove.patch

File 0001-Bug-26039-FIXUP-profiledir-preferences-extension-ove.patch, 7.6 KB (added by pospeselr, 11 months ago)
  • deleted file projects/tor-browser/Bundle-Data/PTConfigs/extension-overrides.js

    From da38a82a7597f36f1b0f41f1634fed6ea5b9d9df Mon Sep 17 00:00:00 2001
    From: Richard Pospesel <richard@torproject.org>
    Date: Tue, 26 Jun 2018 11:06:57 -0700
    Subject: [PATCH] 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)
    ---
     .../PTConfigs/extension-overrides.js          | 63 -------------------
     projects/tor-browser/build                    | 16 ++---
     2 files changed, 9 insertions(+), 70 deletions(-)
     delete mode 100644 projects/tor-browser/Bundle-Data/PTConfigs/extension-overrides.js
    
    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
    + -  
    1 # Overrides for Extension Preferences
    2 # Tor Browser Bundle
    3 # Do not edit this file.
    4 
    5 # HTTPS Everywhere Preferences:
    6 pref("extensions.https_everywhere._observatory.popup_shown", true);
    7 pref("extensions.https_everywhere.toolbar_hint_shown", true);
    8 
    9 # NoScript Preferences:
    10 pref("capability.policy.maonoscript.javascript.enabled", "allAccess");
    11 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");
    12 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");
    13 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");
    14 pref("noscript.ABE.enabled", false);
    15 pref("noscript.ABE.notify", false);
    16 pref("noscript.ABE.wanIpAsLocal", false);
    17 pref("noscript.confirmUnblock", false);
    18 pref("noscript.contentBlocker", true);
    19 pref("noscript.firstRunRedirection", false);
    20 pref("noscript.global", true);
    21 pref("noscript.gtemp", "");
    22 pref("noscript.opacizeObject", 3);
    23 pref("noscript.forbidWebGL", true);
    24 pref("noscript.forbidFonts", false);
    25 pref("noscript.options.tabSelectedIndexes", "5,0,0");
    26 pref("noscript.policynames", "");
    27 pref("noscript.secureCookies", true);
    28 pref("noscript.showAllowPage", false);
    29 pref("noscript.showBaseDomain", false);
    30 pref("noscript.showDistrust", false);
    31 pref("noscript.showRecentlyBlocked", false);
    32 pref("noscript.showTemp", false);
    33 pref("noscript.showTempToPerm", false);
    34 pref("noscript.showUntrusted", false);
    35 pref("noscript.STS.enabled", false);
    36 pref("noscript.subscription.lastCheck", -142148139);
    37 pref("noscript.temp", "");
    38 pref("noscript.untrusted", "");
    39 pref("noscript.forbidMedia", false);
    40 pref("noscript.allowWhitelistUpdates", false);
    41 pref("noscript.fixLinks", false);
    42 // Now handled by plugins.click_to_play
    43 pref("noscript.forbidFlash", false);
    44 pref("noscript.forbidSilverlight", false);
    45 pref("noscript.forbidJava", false);
    46 pref("noscript.forbidPlugins", false);
    47 // Usability tweaks
    48 pref("noscript.showPermanent", false);
    49 pref("noscript.showTempAllowPage", true);
    50 pref("noscript.showRevokeTemp", true);
    51 pref("noscript.notify", false);
    52 pref("noscript.autoReload", true);
    53 pref("noscript.autoReload.allTabs", false);
    54 pref("noscript.cascadePermissions", true);
    55 pref("noscript.restrictSubdocScripting", true);
    56 pref("noscript.showVolatilePrivatePermissionsToggle", false);
    57 pref("noscript.volatilePrivatePermissions", true);
    58 pref("noscript.clearClick", 0);
    59 
    60 # PDF.js
    61 // needs to be a user_pref because pdf.js blows away non-user prefs with its own
    62 // defaults each time
    63 user_pref("pdfjs.disableRange", true);
  • projects/tor-browser/build

    diff --git a/projects/tor-browser/build b/projects/tor-browser/build
    index 0c3e583..e02d937 100644
    a b mkdir -p $OUTDIR 
    1212# directory named tor-browser (instead of tor-browser_en-US). Therefore we
    1313# stage everything under tor-browser-stage to avoid a conflict.
    1414TB_STAGE_DIR=$distdir/tor-browser-stage
    15 EXTOVERRIDESPATH=$rootdir/Bundle-Data/PTConfigs/extension-overrides.js
     15GENERATEDPREFSPATH=$rootdir/Bundle-Data/PTConfigs/generated-prefs.js
     16# Create initially empty prefs file where we can dump our conditionally included/genetered prefs
     17touch "$GENERATEDPREFSPATH"
    1618
    1719[% IF c("var/osx") %]
    1820  TBDIR="$TB_STAGE_DIR/Tor Browser.app"
    cat Bundle-Data/PTConfigs/[% bundledata_osname %]/torrc-defaults-appendix >> "$T 
    113115[% IF c("var/linux") -%]
    114116  [% IF ! c("var/snowflake") %]
    115117    grep -v 'default_bridge\.snowflake' Bundle-Data/PTConfigs/bridge_prefs.js \
    116        >> "$EXTOVERRIDESPATH"
     118       >> "$GENERATEDPREFSPATH"
    117119  [% ELSE %]
    118     cat Bundle-Data/PTConfigs/bridge_prefs.js >> "$EXTOVERRIDESPATH"
     120    cat Bundle-Data/PTConfigs/bridge_prefs.js >> "$GENERATEDPREFSPATH"
    119121  [% END %]
    120122[% END -%]
    121123[% IF c("var/windows") -%]
    cat Bundle-Data/PTConfigs/[% bundledata_osname %]/torrc-defaults-appendix >> "$T 
    123125  # We don't have fte available on Windows x86_64 yet
    124126  grep -v 'default_bridge\.snowflake' Bundle-Data/PTConfigs/bridge_prefs.js \
    125127  [% IF c("var/windows-x86_64") %]| grep -v 'default_bridge\.fte' [% END %] \
    126       >> "$EXTOVERRIDESPATH"
     128      >> "$GENERATEDPREFSPATH"
    127129[% END -%]
    128130[% IF c("var/osx") -%]
    129131  # FTE is temporarily removed due to bug 18495.
    130132  grep -Ev 'default_bridge\.fte' Bundle-Data/PTConfigs/bridge_prefs.js \
    131133  [% IF ! c("var/snowflake") %]| grep -v 'default_bridge\.snowflake' [% END %] \
    132       >> "$EXTOVERRIDESPATH"
     134      >> "$GENERATEDPREFSPATH"
    133135[% END -%]
    134136cat Bundle-Data/PTConfigs/meek-http-helper-user.js >> "$TBDIR/$MEEKPROFILEPATH/user.js"
    135137
    cat Bundle-Data/PTConfigs/meek-http-helper-user.js >> "$TBDIR/$MEEKPROFILEPATH/u 
    143145[% END %]
    144146
    145147[% IF ! c("var/multi_lingual") %]
    146   echo 'pref("extensions.torlauncher.prompt_for_locale", false);' >> "$EXTOVERRIDESPATH"
     148  echo 'pref("extensions.torlauncher.prompt_for_locale", false);' >> "$GENERATEDPREFSPATH"
    147149[% END %]
    148150
    149151[% IF c("var/linux") %]
    mv chrome/en-US/locale/browser/searchplugins $rootdir 
    171173rm -rf chrome/en-US
    172174unzip omni.ja defaults/preferences/000-tor-browser.js || [ $? -lt 3 ]
    173175# Append our built extension-overrides.js to 000-tor-browser.js
    174 cat "$EXTOVERRIDESPATH" >> defaults/preferences/000-tor-browser.js
     176cat "$GENERATEDPREFSPATH" >> defaults/preferences/000-tor-browser.js
    175177cp defaults/preferences/000-tor-browser.js $rootdir
    176178[% IF c("var/osx") %]
    177179  # Embed our default bookmarks within the en-US locale.