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

File 0001-Bug-26039-profiledir-preferences-extension-overrides.patch, 12.2 KB (added by pospeselr, 14 months ago)
  • deleted file projects/tor-browser/Bundle-Data/mac/TorBrowser/Data/Browser/profile.default/preferences/extension-overrides.js

    From a42574040a543950f94d95a911f083df70cdfa14 Mon Sep 17 00:00:00 2001
    From: Richard Pospesel <richard@torproject.org>
    Date: Tue, 19 Jun 2018 11:45:29 -0700
    Subject: [PATCH] Bug 26039: <profiledir>/preferences/extension-overrides.js
     will not be loaded in ESR 60
    
    The infrastructure for loading extension-overrides.js no longer
    exists in ESR60, so these prefs had to be moved.
    
    Unfortunately, we can't just dump the contents of extension-overrides.js
    into 000-tor-browser.js.  The settings are actually partially built in
    tor-browser-build to conditionally include various bridge strings as well
    as localization settings.  So, we piggy back off this existing build
    process and just append the contents of the partially generated
    extension-overrids.js to 000-tor-browser.js.
    ---
     .../extension-overrides.js                    |  0
     .../preferences/extension-overrides.js        | 63 -------------------
     .../preferences/extension-overrides.js        | 63 -------------------
     projects/tor-browser/build                    | 17 ++---
     4 files changed, 9 insertions(+), 134 deletions(-)
     rename projects/tor-browser/Bundle-Data/{linux/Data/Browser/profile.default/preferences => PTConfigs}/extension-overrides.js (100%)
     delete mode 100644 projects/tor-browser/Bundle-Data/mac/TorBrowser/Data/Browser/profile.default/preferences/extension-overrides.js
     delete mode 100644 projects/tor-browser/Bundle-Data/windows/Data/Browser/profile.default/preferences/extension-overrides.js
    
    diff --git a/projects/tor-browser/Bundle-Data/linux/Data/Browser/profile.default/preferences/extension-overrides.js b/projects/tor-browser/Bundle-Data/PTConfigs/extension-overrides.js
    similarity index 100%
    rename from projects/tor-browser/Bundle-Data/linux/Data/Browser/profile.default/preferences/extension-overrides.js
    rename to projects/tor-browser/Bundle-Data/PTConfigs/extension-overrides.js
    diff --git a/projects/tor-browser/Bundle-Data/mac/TorBrowser/Data/Browser/profile.default/preferences/extension-overrides.js b/projects/tor-browser/Bundle-Data/mac/TorBrowser/Data/Browser/profile.default/preferences/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);
  • deleted file projects/tor-browser/Bundle-Data/windows/Data/Browser/profile.default/preferences/extension-overrides.js

    diff --git a/projects/tor-browser/Bundle-Data/windows/Data/Browser/profile.default/preferences/extension-overrides.js b/projects/tor-browser/Bundle-Data/windows/Data/Browser/profile.default/preferences/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 52678ed..fb3d05e 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
     15EXTOVERRIDESPATH=$rootdir/Bundle-Data/PTConfigs/extension-overrides.js
    1516
    1617[% IF c("var/osx") %]
    1718  TBDIR="$TB_STAGE_DIR/Tor Browser.app"
    TB_STAGE_DIR=$distdir/tor-browser-stage 
    2021  EXTSPATH=Contents/Resources/distribution/extensions
    2122  TORBINPATH=Contents/MacOS/Tor
    2223  TORCONFIGPATH=Contents/Resources/TorBrowser/Tor
    23   EXTOVERRIDESPATH=Contents/Resources/distribution/preferences//extension-overrides.js
    2424  MEEKPROFILEPATH=Contents/Resources/TorBrowser/Tor/PluggableTransports/template-profile.meek-http-helper
    2525
    2626  tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/libdmg') %]
    TB_STAGE_DIR=$distdir/tor-browser-stage 
    3131  DOCSPATH=TorBrowser/Docs
    3232  EXTSPATH=TorBrowser/Data/Browser/profile.default/extensions
    3333  TORCONFIGPATH=TorBrowser/Data/Tor
    34   EXTOVERRIDESPATH=TorBrowser/Data/Browser/profile.default/preferences/extension-overrides.js
    3534  MEEKPROFILEPATH=TorBrowser/Data/Browser/profile.meek-http-helper
    3635
    3736  mkdir -p "$TBDIR/TorBrowser/Data/Browser/Caches"
    cat Bundle-Data/PTConfigs/[% bundledata_osname %]/torrc-defaults-appendix >> "$T 
    126125[% IF c("var/linux") -%]
    127126  [% IF ! c("var/snowflake") %]
    128127    grep -v 'default_bridge\.snowflake' Bundle-Data/PTConfigs/bridge_prefs.js \
    129        >> "$TBDIR/$EXTOVERRIDESPATH"
     128       >> "$EXTOVERRIDESPATH"
    130129  [% ELSE %]
    131     cat Bundle-Data/PTConfigs/bridge_prefs.js >> "$TBDIR/$EXTOVERRIDESPATH"
     130    cat Bundle-Data/PTConfigs/bridge_prefs.js >> "$EXTOVERRIDESPATH"
    132131  [% END %]
    133132[% END -%]
    134133[% IF c("var/windows") -%]
    cat Bundle-Data/PTConfigs/[% bundledata_osname %]/torrc-defaults-appendix >> "$T 
    136135  # We don't have fte available on Windows x86_64 yet
    137136  grep -v 'default_bridge\.snowflake' Bundle-Data/PTConfigs/bridge_prefs.js \
    138137  [% IF c("var/windows-x86_64") %]| grep -v 'default_bridge\.fte' [% END %] \
    139       >> "$TBDIR/$EXTOVERRIDESPATH"
     138      >> "$EXTOVERRIDESPATH"
    140139[% END -%]
    141140[% IF c("var/osx") -%]
    142141  # FTE is temporarily removed due to bug 18495.
    143142  grep -Ev 'default_bridge\.fte' Bundle-Data/PTConfigs/bridge_prefs.js \
    144143  [% IF ! c("var/snowflake") %]| grep -v 'default_bridge\.snowflake' [% END %] \
    145       >> "$TBDIR/$EXTOVERRIDESPATH"
     144      >> "$EXTOVERRIDESPATH"
    146145[% END -%]
    147146cat Bundle-Data/PTConfigs/meek-http-helper-user.js >> "$TBDIR/$MEEKPROFILEPATH/user.js"
    148147
    cat Bundle-Data/PTConfigs/meek-http-helper-user.js >> "$TBDIR/$MEEKPROFILEPATH/u 
    156155[% END %]
    157156
    158157[% IF ! c("var/multi_lingual") %]
    159   echo 'pref("extensions.torlauncher.prompt_for_locale", false);' >> "$TBDIR/$EXTOVERRIDESPATH"
    160   echo 'pref("intl.locale.matchOS", false);' >> "$TBDIR/$EXTOVERRIDESPATH"
     158  echo 'pref("extensions.torlauncher.prompt_for_locale", false);' >> "$EXTOVERRIDESPATH"
     159  echo 'pref("intl.locale.matchOS", false);' >> "$EXTOVERRIDESPATH"
    161160[% END %]
    162161
    163162[% IF c("var/linux") %]
    unzip omni.ja chrome/en-US/locale/browser/searchplugins* || [ $? -lt 3 ] 
    184183mv chrome/en-US/locale/browser/searchplugins $rootdir
    185184rm -rf chrome/en-US
    186185unzip omni.ja defaults/preferences/000-tor-browser.js || [ $? -lt 3 ]
     186# Append our built extension-overrides.js to 000-tor-browser.js
     187cat "$EXTOVERRIDESPATH" >> defaults/preferences/000-tor-browser.js
    187188cp defaults/preferences/000-tor-browser.js $rootdir
    188189[% IF c("var/osx") %]
    189190  # Embed our default bookmarks within the en-US locale.