[tor-commits] [torbrowser/maint-2.4] Bug #3944: Move prefs.js into omni.ja and extension-overrides.

erinn at torproject.org erinn at torproject.org
Tue Feb 19 17:57:52 UTC 2013


commit 909770530607c35071ed8b65e049ba97caed2e77
Author: Kathleen Brade <brade at pearlcrescent.com>
Date:   Fri Feb 8 12:09:48 2013 -0800

    Bug #3944: Move prefs.js into omni.ja and extension-overrides.
    
    Allows TBB updates without resetting people's prefs.
---
 build-scripts/config/browserconfig.properties      |    1 +
 build-scripts/config/extension-overrides.js        |   52 ++++++
 build-scripts/config/pound_tor.js                  |  126 +++++++++++++
 build-scripts/config/prefs.js                      |  189 --------------------
 build-scripts/linux-alpha.mk                       |   66 +++++--
 build-scripts/osx-alpha.mk                         |   58 +++++--
 build-scripts/windows-alpha.mk                     |   70 +++++---
 ...owser-exit-when-not-launched-from-Vidalia.patch |    9 +-
 8 files changed, 322 insertions(+), 249 deletions(-)

diff --git a/build-scripts/config/browserconfig.properties b/build-scripts/config/browserconfig.properties
new file mode 100644
index 0000000..1bd92b2
--- /dev/null
+++ b/build-scripts/config/browserconfig.properties
@@ -0,0 +1 @@
+browser.startup.homepage=https://check.torproject.org/?lang=SHPONKA&small=1&uptodate=1
diff --git a/build-scripts/config/extension-overrides.js b/build-scripts/config/extension-overrides.js
new file mode 100644
index 0000000..7729f9b
--- /dev/null
+++ b/build-scripts/config/extension-overrides.js
@@ -0,0 +1,52 @@
+# Overrides for Extension Preferences
+# Tor Browser Bundle
+# Do not edit this file.
+
+# Torbutton Preferences:
+pref("extensions.torbutton.fresh_install", false);
+pref("extensions.torbutton.proxies_applied", true);
+pref("extensions.torbutton.saved.auto_update", false);
+pref("extensions.torbutton.saved.share_proxy_settings", false);
+pref("extensions.torbutton.saved.socks_version", 5);
+pref("extensions.torbutton.settings_applied", true);
+pref("extensions.torbutton.socks_host", "127.0.0.1");
+pref("extensions.torbutton.socks_port", 9050);
+pref("extensions.torbutton.tor_enabled", true);
+pref("extensions.torbutton.tor_memory_jar", true);
+pref("extensions.torbutton.tz_string", "UTC+00:00");
+
+# HTTPS Everywhere Preferences:
+pref("extensions.https_everywhere._observatory.popup_shown", true);
+
+# NoScript Preferences:
+pref("capability.policy.maonoscript.javascript.enabled", "allAccess");
+pref("capability.policy.maonoscript.sites", "addons.mozilla.org about: about:addons about:blank about:blocked about:certerror about:config about:crashes about:credits about:home about:neterror about:plugins about:privatebrowsing about:sessionrestore chrome: resource:");
+pref("noscript.ABE.enabled", false);
+pref("noscript.ABE.notify", false);
+pref("noscript.ABE.wanIpAsLocal", false);
+pref("noscript.autoReload", false);
+pref("noscript.confirmUnblock", false);
+pref("noscript.contentBlocker", true);
+pref("noscript.default", "about:blank about:credits addons.mozilla.org flashgot.net google.com gstatic.com googlesyndication.com informaction.com yahoo.com yimg.com maone.net noscript.net hotmail.com msn.com passport.com passport.net passportimages.com live.com");
+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.showRevokeTemp", false);
+pref("noscript.showTemp", false);
+pref("noscript.showTempAllowPage", 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", "");
diff --git a/build-scripts/config/pound_tor.js b/build-scripts/config/pound_tor.js
new file mode 100644
index 0000000..78108f8
--- /dev/null
+++ b/build-scripts/config/pound_tor.js
@@ -0,0 +1,126 @@
+# Default Preferences
+# Tor Browser Bundle
+# Do not edit this file.
+
+pref("app.update.auto", false);
+pref("app.update.enabled", false);
+pref("browser.bookmarks.livemark_refresh_seconds", 31536000);
+pref("browser.cache.disk.capacity", 0);
+pref("browser.cache.disk.enable", false);
+pref("browser.cache.disk.smart_size.enabled", false);
+pref("browser.cache.disk.smart_size.first_run", false);
+pref("browser.cache.offline.enable", false);
+pref("browser.chrome.favicons", false);
+pref("browser.chrome.image_icons.max_size", 0);
+pref("browser.chrome.site_icons", false);
+pref("browser.download.manager.retention", 1);
+pref("browser.download.useDownloadDir", false);
+pref("browser.formfill.enable", false);
+pref("browser.history_expire_days.mirror", 0);
+pref("browser.microsummary.updateGenerators", false);
+pref("browser.migration.version", 5);
+pref("browser.places.importBookmarksHTML", false);
+pref("browser.places.importDefaults", false);
+pref("browser.places.leftPaneFolderId", -1);
+pref("browser.places.migratePostDataAnnotations", false);
+pref("browser.places.smartBookmarksVersion", 2);
+pref("browser.places.updateRecentTagsUri", false);
+pref("browser.preferences.advanced.selectedTabIndex", 0);
+pref("browser.privatebrowsing.autostart", false);
+pref("browser.rights.3.shown", true);
+pref("browser.safebrowsing.enabled", false);
+pref("browser.safebrowsing.malware.enabled", false);
+pref("browser.search.suggest.enabled", false);
+pref("browser.search.update", false);
+pref("browser.sessionstore.privacy_level", 2);
+pref("browser.shell.checkDefaultBrowser", false);
+pref("browser.startup.homepage_override.buildID", "20110325121920");
+pref("browser.startup.homepage_override.mstone", "rv:2.0");
+pref("browser.urlbar.autocomplete.enabled", true);
+pref("dom.event.contextmenu.enabled", false);
+pref("extensions.autoDisableScopes", 0);
+pref("extensions.bootstrappedAddons", "{}");
+pref("extensions.checkCompatibility.4.*", false);
+pref("extensions.checkUpdateSecurity", true);
+pref("extensions.databaseSchema", 3);
+pref("extensions.enabledAddons", "https-everywhere at eff.org:0.9.9.development.4,{73a6fe31-595d-460b-a920-fcc0f8843232}:2.1.0.3,{d40f5e7b-d2cf-4856-b441-cc613eeffbe3}:1.50,{e0204bd5-9d31-402b-a99d-a6aa8ffebdca}:1.3.3-alpha");
+pref("extensions.enabledItems", "langpack-en-US at firefox.mozilla.org:,{73a6fe31-595d-460b-a920-fcc0f8843232}:1.9.9.57,{e0204bd5-9d31-402b-a99d-a6aa8ffebdca}:1.2.4,{972ce4c6-7e08-4474-a285-3208198ce6fd}:3.5.8");
+pref("extensions.enabledScopes", 1);
+pref("extensions.pendingOperations", false);
+pref("extensions.update.enabled", true);
+pref("general.appname.override", "Netscape");
+pref("general.appversion.override", "5.0 (Windows)");
+pref("general.buildID.override", "0");
+pref("general.useragent.locale", "SHPONKA");
+pref("general.oscpu.override", "Windows NT 6.1");
+pref("general.platform.override", "Win32");
+pref("general.productSub.override", "20100101");
+pref("general.useragent.override", "Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20100101 Firefox/17.0");
+pref("general.useragent.vendor", "");
+pref("general.useragent.vendorSub", "");
+pref("geo.enabled", false);
+pref("geo.wifi.uri", "");
+pref("intl.accept_languages", "en-us, en");
+pref("intl.charsetmenu.browser.cache", "UTF-8");
+pref("network.cookie.cookieBehavior", 1);
+pref("network.cookie.lifetimePolicy", 2);
+pref("network.cookie.prefsMigrated", true);
+pref("network.http.pipelining", true);
+pref("network.http.pipelining.aggressive", true);
+pref("network.http.pipelining.maxrequests", 12);
+pref("network.http.pipelining.ssl", true);
+pref("network.http.proxy.pipelining", true);
+pref("network.hosts.pop_server", "");
+pref("network.protocol-handler.external-default", false);
+pref("network.protocol-handler.external.mailto", false);
+pref("network.protocol-handler.external.news", false);
+pref("network.protocol-handler.external.nntp", false);
+pref("network.protocol-handler.external.snews", false);
+pref("network.protocol-handler.warn-external.mailto", true);
+pref("network.protocol-handler.warn-external.news", true);
+pref("network.protocol-handler.warn-external.nntp", true);
+pref("network.protocol-handler.warn-external.snews", true);
+pref("network.proxy.socks", "127.0.0.1");
+pref("network.proxy.socks_port", 9050);
+pref("network.proxy.socks_remote_dns", true);
+pref("network.proxy.type", 1);
+pref("network.security.ports.banned", "8118,8123,9050,9051");
+pref("webgl.min_capability_mode", true);
+pref("webgl.disable-extensions", true);
+pref("places.history.enabled", false);
+pref("places.history.expiration.transient_current_max_pages", 120795);
+pref("plugin.disable_full_page_plugin_for_types", "application/asx,video/x-ms-asf-plugin,application/x-mplayer2,video/x-ms-asf,video/x-ms-wm,audio/x-ms-wma,audio/x-ms-wax,video/x-ms-wmv,video/x-ms-wvx,application/x-drm-v2,application/x-drm");
+pref("plugin.expose_full_path", true);
+pref("plugin.scan.4xPluginFolder", false);
+pref("plugin.scan.Acrobat", "99.0");
+pref("plugin.scan.Quicktime", "99.0");
+pref("plugin.scan.SunJRE", "99.0");
+pref("plugin.scan.WindowsMediaPlayer", "99.0");
+pref("plugin.scan.plid.all", false);
+pref("privacy.sanitize.migrateFx3Prefs", true);
+pref("security.enable_java", false);
+pref("signon.rememberSignons", false);
+pref("signon.autofillForms", false);
+pref("xpinstall.whitelist.add", "");
+pref("xpinstall.whitelist.add.36", "");
+pref("security.ssl.enable_false_start", true);
+pref("dom.battery.enabled", false); // fingerprinting due to differing OS implementations
+pref("dom.network.enabled",false); // fingerprinting due to differing OS implementations
+pref("browser.display.max_font_attempts",10);
+pref("browser.display.max_font_count",5);
+pref("browser.sessionstore.resume_from_crash",false);
+pref("browser.search.order.1", "Startpage");
+pref("browser.search.order.2", "DuckDuckGo");
+pref("browser.search.order.3", "Google");
+pref("browser.search.selectedEngine", "Startpage"); // bam
+pref("keyword.URL", "https://startpage.com/do/search?q=");
+pref("dom.indexedDB.enabled", false);
+pref("security.enable_tls_session_tickets", false);
+pref("network.http.keep-alive.timeout", 20);
+pref("permissions.memory_only", true);
+pref("browser.zoom.siteSpecific", false);
+pref("network.http.spdy.enabled", false); // Stores state and may have keepalive issues (both fixable)
+pref("network.dns.disablePrefetch", true);
+pref("dom.enable_performance", false);
+pref("plugin.expose_full_path", false);
+pref("network.http.connection-retry-timeout", 0);
diff --git a/build-scripts/config/prefs.js b/build-scripts/config/prefs.js
deleted file mode 100644
index 3808984..0000000
--- a/build-scripts/config/prefs.js
+++ /dev/null
@@ -1,189 +0,0 @@
-# Mozilla User Preferences
-
-/* Do not edit this file.
- *
- * If you make changes to this file while the application is running,
- * the changes will be overwritten when the application exits.
- *
- * To make a manual change to preferences, you can visit the URL about:config
- * For more information, see http://www.mozilla.org/unix/customizing.html#prefs
- */
-
-user_pref("app.update.auto", false);
-user_pref("app.update.enabled", false);
-user_pref("app.update.lastUpdateTime.addon-background-update-timer", 1216566538);
-user_pref("app.update.lastUpdateTime.background-update-timer", 1216566535);
-user_pref("app.update.lastUpdateTime.blocklist-background-update-timer", 1216566538);
-user_pref("app.update.lastUpdateTime.microsummary-generator-update-timer", 1232574822);
-user_pref("app.update.lastUpdateTime.search-engine-update-timer", 1216566539);
-user_pref("browser.bookmarks.livemark_refresh_seconds", 31536000);
-user_pref("browser.cache.disk.capacity", 0);
-user_pref("browser.cache.disk.enable", false);
-user_pref("browser.cache.disk.smart_size.enabled", false);
-user_pref("browser.cache.disk.smart_size.first_run", false);
-user_pref("browser.cache.offline.enable", false);
-user_pref("browser.chrome.favicons", false);
-user_pref("browser.chrome.image_icons.max_size", 0);
-user_pref("browser.chrome.site_icons", false);
-user_pref("browser.download.manager.retention", 1);
-user_pref("browser.download.useDownloadDir", false);
-user_pref("browser.formfill.enable", false);
-user_pref("browser.history_expire_days.mirror", 0);
-user_pref("browser.microsummary.updateGenerators", false);
-user_pref("browser.migration.version", 5);
-user_pref("browser.places.importBookmarksHTML", false);
-user_pref("browser.places.importDefaults", false);
-user_pref("browser.places.leftPaneFolderId", -1);
-user_pref("browser.places.migratePostDataAnnotations", false);
-user_pref("browser.places.smartBookmarksVersion", 2);
-user_pref("browser.places.updateRecentTagsUri", false);
-user_pref("browser.preferences.advanced.selectedTabIndex", 0);
-user_pref("browser.privatebrowsing.autostart", false);
-user_pref("browser.rights.3.shown", true);
-user_pref("browser.safebrowsing.enabled", false);
-user_pref("browser.safebrowsing.malware.enabled", false);
-user_pref("browser.search.suggest.enabled", false);
-user_pref("browser.search.update", false);
-user_pref("browser.sessionstore.privacy_level", 2);
-user_pref("browser.shell.checkDefaultBrowser", false);
-user_pref("browser.startup.homepage", "https://check.torproject.org/?lang=SHPONKA&small=1&uptodate=1");
-user_pref("browser.startup.homepage_override.buildID", "20110325121920");
-user_pref("browser.startup.homepage_override.mstone", "rv:2.0");
-user_pref("browser.urlbar.autocomplete.enabled", true);
-user_pref("capability.policy.maonoscript.javascript.enabled", "allAccess");
-user_pref("capability.policy.maonoscript.sites", "addons.mozilla.org about: about:addons about:blank about:blocked about:certerror about:config about:crashes about:credits about:home about:neterror about:plugins about:privatebrowsing about:sessionrestore chrome: resource:");
-user_pref("dom.event.contextmenu.enabled", false);
-user_pref("extensions.autoDisableScopes", 0);
-user_pref("extensions.bootstrappedAddons", "{}");
-user_pref("extensions.checkCompatibility.4.*", false);
-user_pref("extensions.checkUpdateSecurity", true);
-user_pref("extensions.databaseSchema", 3);
-user_pref("extensions.enabledAddons", "https-everywhere at eff.org:0.9.9.development.4,{73a6fe31-595d-460b-a920-fcc0f8843232}:2.1.0.3,{d40f5e7b-d2cf-4856-b441-cc613eeffbe3}:1.50,{e0204bd5-9d31-402b-a99d-a6aa8ffebdca}:1.3.3-alpha");
-user_pref("extensions.enabledItems", "langpack-en-US at firefox.mozilla.org:,{73a6fe31-595d-460b-a920-fcc0f8843232}:1.9.9.57,{e0204bd5-9d31-402b-a99d-a6aa8ffebdca}:1.2.4,{972ce4c6-7e08-4474-a285-3208198ce6fd}:3.5.8");
-user_pref("extensions.enabledScopes", 1);
-user_pref("extensions.https_everywhere._observatory.popup_shown", true);
-user_pref("extensions.pendingOperations", false);
-user_pref("extensions.torbutton.fresh_install", false);
-user_pref("extensions.torbutton.locked_mode", true);
-user_pref("extensions.torbutton.proxies_applied", true);
-user_pref("extensions.torbutton.restore_tor", true);
-user_pref("extensions.torbutton.saved.auto_update", false);
-user_pref("extensions.torbutton.saved.share_proxy_settings", false);
-user_pref("extensions.torbutton.saved.socks_version", 5);
-user_pref("extensions.torbutton.settings_applied", true);
-user_pref("extensions.torbutton.socks_host", "127.0.0.1");
-user_pref("extensions.torbutton.socks_port", 9050);
-user_pref("extensions.torbutton.tor_enabled", true);
-user_pref("extensions.torbutton.tor_memory_jar", true);
-user_pref("extensions.torbutton.tz_string", "UTC+00:00");
-user_pref("extensions.update.enabled", true);
-user_pref("general.appname.override", "Netscape");
-user_pref("general.appversion.override", "5.0 (Windows)");
-user_pref("general.buildID.override", "0");
-user_pref("general.useragent.locale", "SHPONKA");
-user_pref("general.oscpu.override", "Windows NT 6.1");
-user_pref("general.platform.override", "Win32");
-user_pref("general.productSub.override", "20100101");
-user_pref("general.useragent.override", "Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20100101 Firefox/17.0");
-user_pref("general.useragent.vendor", "");
-user_pref("general.useragent.vendorSub", "");
-user_pref("geo.enabled", false);
-user_pref("geo.wifi.uri", "");
-user_pref("intl.accept_languages", "en-us, en");
-user_pref("intl.charsetmenu.browser.cache", "UTF-8");
-user_pref("network.cookie.cookieBehavior", 1);
-user_pref("network.cookie.lifetimePolicy", 2);
-user_pref("network.cookie.prefsMigrated", true);
-user_pref("network.http.pipelining", true);
-user_pref("network.http.pipelining.aggressive", true);
-user_pref("network.http.pipelining.maxrequests", 12);
-user_pref("network.http.pipelining.ssl", true);
-user_pref("network.http.proxy.pipelining", true);
-user_pref("network.hosts.pop_server", "");
-user_pref("network.protocol-handler.external-default", false);
-user_pref("network.protocol-handler.external.mailto", false);
-user_pref("network.protocol-handler.external.news", false);
-user_pref("network.protocol-handler.external.nntp", false);
-user_pref("network.protocol-handler.external.snews", false);
-user_pref("network.protocol-handler.warn-external.mailto", true);
-user_pref("network.protocol-handler.warn-external.news", true);
-user_pref("network.protocol-handler.warn-external.nntp", true);
-user_pref("network.protocol-handler.warn-external.snews", true);
-user_pref("network.proxy.socks", "127.0.0.1");
-user_pref("network.proxy.socks_port", 9050);
-user_pref("network.proxy.socks_remote_dns", true);
-user_pref("network.proxy.type", 1);
-user_pref("network.security.ports.banned", "8118,8123,9050,9051");
-user_pref("noscript.ABE.enabled", false);
-user_pref("noscript.ABE.notify", false);
-user_pref("noscript.ABE.wanIpAsLocal", false);
-user_pref("noscript.autoReload", false);
-user_pref("noscript.confirmUnblock", false);
-user_pref("noscript.contentBlocker", true);
-user_pref("noscript.default", "about:blank about:credits addons.mozilla.org flashgot.net google.com gstatic.com googlesyndication.com informaction.com yahoo.com yimg.com maone.net noscript.net hotmail.com msn.com passport.com passport.net passportimages.com live.com");
-user_pref("noscript.firstRunRedirection", false);
-user_pref("noscript.global", true);
-user_pref("noscript.gtemp", "");
-user_pref("noscript.opacizeObject", 3);
-user_pref("noscript.forbidWebGL", true);
-user_pref("noscript.forbidFonts", false);
-user_pref("webgl.min_capability_mode", true);
-user_pref("webgl.disable-extensions", true);
-user_pref("noscript.options.tabSelectedIndexes", "5,0,0");
-user_pref("noscript.policynames", "");
-user_pref("noscript.secureCookies", true);
-user_pref("noscript.showAllowPage", false);
-user_pref("noscript.showBaseDomain", false);
-user_pref("noscript.showDistrust", false);
-user_pref("noscript.showRecentlyBlocked", false);
-user_pref("noscript.showRevokeTemp", false);
-user_pref("noscript.showTemp", false);
-user_pref("noscript.showTempAllowPage", false);
-user_pref("noscript.showTempToPerm", false);
-user_pref("noscript.showUntrusted", false);
-user_pref("noscript.STS.enabled", false);
-user_pref("noscript.subscription.lastCheck", -142148139);
-user_pref("noscript.temp", "");
-user_pref("noscript.untrusted", "");
-user_pref("places.history.enabled", false);
-user_pref("places.history.expiration.transient_current_max_pages", 120795);
-user_pref("plugin.disable_full_page_plugin_for_types", "application/asx,video/x-ms-asf-plugin,application/x-mplayer2,video/x-ms-asf,video/x-ms-wm,audio/x-ms-wma,audio/x-ms-wax,video/x-ms-wmv,video/x-ms-wvx,application/x-drm-v2,application/x-drm");
-user_pref("plugin.expose_full_path", true);
-user_pref("plugin.scan.4xPluginFolder", false);
-user_pref("plugin.scan.Acrobat", "99.0");
-user_pref("plugin.scan.Quicktime", "99.0");
-user_pref("plugin.scan.SunJRE", "99.0");
-user_pref("plugin.scan.WindowsMediaPlayer", "99.0");
-user_pref("plugin.scan.plid.all", false);
-user_pref("privacy.sanitize.migrateFx3Prefs", true);
-user_pref("security.enable_java", false);
-user_pref("signon.rememberSignons", false);
-user_pref("signon.autofillForms", false);
-user_pref("urlclassifier.keyupdatetime.https://sb-ssl.google.com/safebrowsing/newkey", 1235166825);
-user_pref("urlclassifier.tableversion.goog-black-enchash", "1.55536");
-user_pref("urlclassifier.tableversion.goog-black-url", "1.23256");
-user_pref("urlclassifier.tableversion.goog-white-domain", "1.481");
-user_pref("urlclassifier.tableversion.goog-white-url", "1.371");
-user_pref("xpinstall.whitelist.add", "");
-user_pref("xpinstall.whitelist.add.36", "");
-user_pref("security.ssl.enable_false_start", true);
-user_pref("dom.battery.enabled", false); // fingerpriting due to differing OS implementations
-user_pref("dom.network.enabled",false); // fingerprinting due to differing OS implementations
-user_pref("browser.display.max_font_attempts",10);
-user_pref("browser.display.max_font_count",5);
-user_pref("browser.sessionstore.resume_from_crash",false);
-user_pref("browser.search.order.1", "Startpage");
-user_pref("browser.search.order.2", "DuckDuckGo");
-user_pref("browser.search.order.3", "Google");
-user_pref("browser.search.selectedEngine", "Startpage"); // bam
-user_pref("keyword.URL", "https://startpage.com/do/search?q=");
-user_pref("dom.indexedDB.enabled", false);
-user_pref("security.enable_tls_session_tickets", false);
-user_pref("network.http.keep-alive.timeout", 20);
-user_pref("permissions.memory_only", true);
-user_pref("browser.zoom.siteSpecific", false);
-user_pref("network.http.spdy.enabled", false); // Stores state and may have keepalive issues (both fixable)
-user_pref("network.dns.disablePrefetch", true);
-user_pref("dom.enable_performance", false);
-user_pref("plugin.expose_full_path", false);
-user_pref("network.http.connection-retry-timeout", 0);
diff --git a/build-scripts/linux-alpha.mk b/build-scripts/linux-alpha.mk
index 1245f42..069b685 100644
--- a/build-scripts/linux-alpha.mk
+++ b/build-scripts/linux-alpha.mk
@@ -315,11 +315,24 @@ endif
 
 ## Configure Firefox, Vidalia, and Tor
 configure-apps:
-	## Configure Firefox preferences
+	## Configure Firefox bookmarks
 	mkdir -p $(DEST)/Data/profile/extensions
 	cp -R config/firefox-profiles.ini $(DEST)/Data/profiles.ini
 	cp config/bookmarks.html $(DEST)/Data/profile
-	cp config/prefs.js $(DEST)/Data/profile/prefs.js
+
+	## Override Firefox extension preferences
+	mkdir -p $(DEST)/Data/profile/preferences
+	cp config/extension-overrides.js $(DEST)/Data/profile/preferences
+
+	## Patch Firefox default home page
+	CHROME_EN_DIR=$(APPDIR)/Firefox/chrome/en-US;							\
+	mkdir -p "$$CHROME_EN_DIR/locale/branding";								\
+	sed -e "s/SHPONKA/en-US/g" config/browserconfig.properties				\
+		> "$$CHROME_EN_DIR/locale/branding/browserconfig.properties";		\
+	(cd $(APPDIR)/Firefox;													\
+		zip -u omni.ja chrome/en-US/locale/branding/browserconfig.properties); \
+	rm -rf "$$CHROME_EN_DIR"
+
 	## Configure Pidgin
 ifeq ($(USE_PIDGIN),1)
 	mkdir -p $(DEST)/PidginPortable/Data/settings/.purple
@@ -369,8 +382,9 @@ compressed-bundle_%:
 	LANGCODE=$* make -f linux-alpha.mk compressed-bundle-localized
 
 bundle-localized_%.stamp:
-	make -f linux-alpha.mk copy-files_$* install-extensions install-torbutton install-pdfjs install-lang-extensions patch-vidalia-language patch-firefox-language \
-	patch-pidgin-language update-extension-pref write-tbb-version
+	make -f linux-alpha.mk copy-files_$* install-extensions				\
+	install-torbutton install-pdfjs install-lang-extensions				\
+	patch-vidalia-language patch-firefox-config patch-pidgin-language
 	touch $(STAMP_DIR)/bundle-localized_$*.stamp
 
 bundle-localized: bundle-localized_$(LANGCODE).stamp
@@ -413,6 +427,15 @@ install-lang-extensions: $(filter-out langpack_en-US.xpi,langpack_$(LANGCODE).xp
 ifneq ($(LANGCODE), en-US)
 	mkdir -p $(BUNDLE)/Data/profile/extensions
 	cp langpack_$(LANGCODE).xpi $(BUNDLE)/Data/profile/extensions/langpack-$(LANGCODE)@firefox.mozilla.org.xpi
+	## Patch Firefox default home page within language pack
+	CHROMEDIR=$(BUNDLE)/Data/profile/extensions/chrome;						\
+	mkdir -p "$$CHROMEDIR";													\
+	sed -e "s/SHPONKA/$(LANGCODE)/g" config/browserconfig.properties		\
+		> "$$CHROMEDIR/$(LANGCODE)/locale/branding/browserconfig.properties"; \
+	(cd $(BUNDLE)/FirefoxPortable/Data/profile/extensions;					\
+		zip -u langpack-$(LANGCODE)@firefox.mozilla.org.xpi					\
+		chrome/$(LANGCODE)/locale/branding/browserconfig.properties);		\
+	rm -rf "$$CHROMEDIR"
 endif
 
 ## Set the language for Vidalia
@@ -429,26 +452,29 @@ ifeq ($(USE_PIDGIN),1)
 				   $(BUNDLE)/PidginPortable/App/GTK/share/locale
 endif
 
-patch-firefox-language:
-	## Patch the default Firefox prefs.js
+patch-firefox-config:
+	## Patch Firefox default preferences by adding a patched #tor.js file:
+	PREFSDIR=$(BUNDLE)/App/Firefox/defaults/preferences;					\
+	mkdir -p "$$PREFSDIR";													\
+	sed -e "s/SHPONKA/$(LANGCODE)/g" config/pound_tor.js					\
+		> "$$PREFSDIR/#tor.js";												\
+	./patch-firefox-language.sh "$$PREFSDIR/#tor.js" $(LANGCODE) -e;		\
+	printf 'pref("torbrowser.version", "%s");\n'							\
+			"$(RELEASE_VER)-$(BUILD_NUM)-$(PLATFORM)"						\
+			>> "$$PREFSDIR/#tor.js";										\
+	(cd $(BUNDLE)/App/Firefox; zip -u omni.ja defaults/preferences/#tor.js);\
+	rm -rf "$$PREFSDIR"
+	##
+	## Copy other Firefox configuration files into our bundle
 	## Don't use {} because they aren't always interpreted correctly. Thanks, sh. 
-	mkdir -p $(BUNDLE)/App/Firefox/defaults/profile/
+	mkdir -p $(BUNDLE)/App/Firefox/defaults/profile/preferences
 	cp config/bookmarks.html $(BUNDLE)/App/Firefox/defaults/profile/
-	cp config/prefs.js $(BUNDLE)/App/Firefox/defaults/profile/prefs.js
+	cp config/extension-overrides.js										\
+		$(BUNDLE)/App/Firefox/defaults/profile/preferences
+	mkdir -p $(BUNDLE)/Data/profile/preferences
 	cp config/bookmarks.html $(BUNDLE)/Data/profile
-	cp config/prefs.js $(BUNDLE)/Data/profile/prefs.js
-	./patch-firefox-language.sh $(BUNDLE)/App/Firefox/defaults/profile/prefs.js $(LANGCODE) -e
-	./patch-firefox-language.sh $(BUNDLE)/Data/profile/prefs.js $(LANGCODE) -e
-
-## Fix prefs.js since extensions.checkCompatibility, false doesn't work
-update-extension-pref:
-	sed -i -e "s/SHPONKA/$(LANGCODE)/g" $(BUNDLE)/Data/profile/prefs.js
-	sed -i -e "s/SHPONKA/$(LANGCODE)/g" $(BUNDLE)/App/Firefox/defaults/profile/prefs.js
+	cp config/extension-overrides.js $(BUNDLE)/Data/profile/preferences
 
 print-version:
 	@echo $(RELEASE_VER)-$(BUILD_NUM)
 
-write-tbb-version:
-	printf 'user_pref("torbrowser.version", "%s");\n' "$(RELEASE_VER)-$(BUILD_NUM)-$(PLATFORM)-$(ARCH_TYPE)" >> $(BUNDLE)/App/Firefox/defaults/profile/prefs.js
-	printf 'user_pref("torbrowser.version", "%s");\n' "$(RELEASE_VER)-$(BUILD_NUM)-$(PLATFORM)-$(ARCH_TYPE)" >> $(BUNDLE)/Data/profile/prefs.js
-
diff --git a/build-scripts/osx-alpha.mk b/build-scripts/osx-alpha.mk
index 95dc973..fc281b3 100644
--- a/build-scripts/osx-alpha.mk
+++ b/build-scripts/osx-alpha.mk
@@ -323,7 +323,18 @@ configure-apps:
 	#mkdir -p $(DEST)/.mozilla/Firefox/firefox.default
 	cp -R config/firefox-profiles.ini $(DEST)/Contents/MacOS/TorBrowser.app/Contents/MacOS/Data/profiles.ini
 	cp config/bookmarks.html $(DEST)/Contents/MacOS/TorBrowser.app/Contents/MacOS/Data/profile
-	cp config/prefs.js $(DEST)/Contents/MacOS/TorBrowser.app/Contents/MacOS/Data/profile/prefs.js
+	## Override Firefox extension preferences
+	mkdir -p $(DEST)/Contents/MacOS/TorBrowser.app/Contents/MacOS/Data/profile/preferences
+	cp config/extension-overrides.js $(DEST)/Contents/MacOS/TorBrowser.app/Contents/MacOS/Data/profile/preferences/
+	## Patch Firefox default home page
+	CHROMEDIR=$(DEST)/Contents/MacOS/TorBrowser.app/Contents/MacOS/chrome;	\
+	mkdir -p "$$CHROMEDIR/en-US/locale/branding";							\
+	sed -e "s/SHPONKA/en-US/g" config/browserconfig.properties				\
+		> "$$CHROMEDIR/en-US/locale/branding/browserconfig.properties";		\
+	(cd $(DEST)/Contents/MacOS/TorBrowser.app/Contents/MacOS;				\
+		zip -u omni.ja chrome/en-US/locale/branding/browserconfig.properties);\
+	rm -rf "$$CHROMEDIR"
+
 	cp config/Info.plist $(DEST)/Contents
 	cp config/PkgInfo $(DEST)/Contents
 	cp config/qt.conf $(DEST)/Contents/MacOS/Vidalia.app/Contents/Resources
@@ -371,7 +382,10 @@ bundle_%:
 compressed-bundle_%:
 	LANGCODE=$* make -f osx-alpha.mk compressed-bundle-localized
 bundle-localized_%.stamp:
-	make -f osx-alpha.mk copy-files_$* install-torbutton install-httpseverywhere install-noscript install-pdfjs install-lang-extensions patch-vidalia-language patch-firefox-language patch-pidgin-language update-extension-pref write-tbb-version final
+	make -f osx-alpha.mk copy-files_$* install-torbutton					\
+		install-httpseverywhere install-noscript install-pdfjs				\
+		install-lang-extensions patch-vidalia-language						\
+		patch-firefox-config patch-pidgin-language final
 	touch $(STAMP_DIR)/bundle-localized_$*.stamp
 
 bundle-localized: bundle-localized_$(LANGCODE).stamp
@@ -409,6 +423,16 @@ install-lang-extensions: $(filter-out langpack_en-US.xpi,langpack_$(LANGCODE).xp
 ifneq ($(LANGCODE), en-US)
 	mkdir -p $(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/extensions/
 	cp langpack_$(LANGCODE).xpi $(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/extensions/langpack-$(LANGCODE)@firefox.mozilla.org.xpi
+	## Patch Firefox default home page within language pack
+	CHROMEDIR=$(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/extensions/chrome; \
+	mkdir -p "$$CHROMEDIR/$(LANGCODE)/locale/branding";						\
+	sed -e "s/SHPONKA/$(LANGCODE)/g" config/browserconfig.properties		\
+		> "$$CHROMEDIR/$(LANGCODE)/locale/branding/browserconfig.properties"; \
+	(cd $(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/extensions/; \
+			zip -u langpack-$(LANGCODE)@firefox.mozilla.org.xpi				\
+			chrome/$(LANGCODE)/locale/branding/browserconfig.properties);	\
+	rm -rf "$$CHROMEDIR"
+
 endif
 
 install-torbutton: torbutton.xpi
@@ -442,23 +466,27 @@ ifeq ($(USE_PIDGIN),1)
 	$(BUNDLE)/PidginPortable/App/GTK/share/locale
 endif
 
-patch-firefox-language:
-	## Patch the default Firefox prefs.js
-	## Don't use {} because they aren't always interpreted correctly. Thanks, sh. 
-	cp config/prefs.js $(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/prefs.js
+patch-firefox-config:
+	## Patch Firefox default preferences by adding a patched #tor.js file:
+	PREFSDIR=$(BUNDLE)/Contents/MacOS/TorBrowser.app/Contents/MacOS/defaults/preferences; \
+	mkdir -p "$$PREFSDIR";													\
+	sed -e "s/SHPONKA/$(LANGCODE)/g" config/pound_tor.js					\
+		> "$$PREFSDIR/#tor.js";												\
+	./patch-firefox-language.sh "$$PREFSDIR/#tor.js" $(LANGCODE) -e;		\
+	printf 'pref("torbrowser.version", "%s");\n'							\
+			"$(RELEASE_VER)-$(BUILD_NUM)-$(PLATFORM)"						\
+			>> "$$PREFSDIR/#tor.js";										\
+	(cd $(BUNDLE)/Contents/MacOS/TorBrowser.app/Contents/MacOS;				\
+			zip -u omni.ja defaults/preferences/#tor.js);					\
+	rm -rf "$$PREFSDIR"
+	## Copy bookmarks and extension pref. overrides into profile
 	cp config/bookmarks.html $(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile
-	./patch-firefox-language.sh $(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/prefs.js $(LANGCODE) -e
-
-## Fix prefs.js since extensions.checkCompatibility, false doesn't work
-update-extension-pref:
-	sed -i -e "s/SHPONKA/$(LANGCODE)/g" $(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/prefs.js
-	sed -i -e "s/SHPONKA/$(LANGCODE)/g" $(BUNDLE)/Contents/MacOS/TorBrowser.app/Contents/MacOS/Data/profile/prefs.js
+	OVERRIDEDIR=$(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/preferences; \
+	mkdir "$$OVERRIDEDIR";													\
+	cp config/extension-overrides.js "$$OVERRIDEDIR"
 
 print-version:
 	@echo $(RELEASE_VER)-$(BUILD_NUM)
 
-write-tbb-version:
-	printf 'user_pref("torbrowser.version", "%s");\n' "$(RELEASE_VER)-$(BUILD_NUM)-$(PLATFORM)-$(ARCH_TYPE)" >> $(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/prefs.js
-
 final:
 	mv $(BUNDLE) $(BUNDLE).app
diff --git a/build-scripts/windows-alpha.mk b/build-scripts/windows-alpha.mk
index 40222ca..cc48da9 100644
--- a/build-scripts/windows-alpha.mk
+++ b/build-scripts/windows-alpha.mk
@@ -17,7 +17,7 @@ BUILD_NUM=1
 PLATFORM=Windows
 
 ## Location of required libraries
-MING=/mingw/bin
+MING=/c/mingw/bin
 QT_LIB=/c/Qt/$(QT_VER)/bin
 OPENSSL_LIB=$(COMPILED_BINS)
 WIX_LIB="$(MOZBUILD_DIR)/wix-351728"
@@ -110,7 +110,7 @@ ifeq ($(USE_OBFSPROXY),1)
 	cd $(OBFSPROXY_DIR) && make install
 endif
 
-build-firefox: $(FIREFOX_DIR) config/dot_mozconfig $(MOZBUILD_DIR) $(MOZBUILD_DIR)/start-msvc$(MSVC_VER).bat | $(PYTHON) $(PYMAKE_DIR)
+build-firefox: $(FIREFOX_DIR) config/dot_mozconfig $(MOZBUILD_DIR)
 	cp config/dot_mozconfig $(FIREFOX_DIR)/mozconfig
 	cp branding/* $(FIREFOX_DIR)/browser/branding/official
 	cd $(MOZBUILD_DIR) && cmd.exe /c "start-msvc$(MSVC_VER).bat $(FIREFOX_DIR) $(PYTHON) $(PYMAKE)"
@@ -313,14 +313,29 @@ endif
 
 ## Configure Firefox, FirefoxPortable, Vidalia, and Tor
 configure-apps:
-
 	mkdir -p $(DEST)/FirefoxPortable/Data/profile
 	mkdir -p $(DEST)/FirefoxPortable/App/DefaultData/profile
-	## Configure Firefox preferences
-	cp config/prefs.js $(DEST)/FirefoxPortable/App/DefaultData/profile/prefs.js
-	cp config/prefs.js $(DEST)/FirefoxPortable/Data/profile/prefs.js
+	## Configure Firefox bookmarks
 	cp config/bookmarks.html $(DEST)/FirefoxPortable/App/DefaultData/profile/
 
+	## Override Firefox extension preferences
+	mkdir -p $(DEST)/FirefoxPortable/App/DefaultData/profile/preferences
+	cp config/extension-overrides.js										\
+		$(DEST)/FirefoxPortable/App/DefaultData/profile/preferences/
+	mkdir -p $(DEST)/FirefoxPortable/Data/profile/preferences
+	cp config/extension-overrides.js										\
+		$(DEST)/FirefoxPortable/Data/profile/preferences/
+
+	## Patch Firefox default home page
+	CHROMEDIR=$(DEST)/FirefoxPortable/App/Firefox/chrome;					\
+	mkdir -p "$$CHROMEDIR/en-US/locale/branding";							\
+	sed -e "s/SHPONKA/en-US/g" config/browserconfig.properties				\
+		> "$$CHROMEDIR/en-US/locale/branding/browserconfig.properties";		\
+	(cd $(DEST)/FirefoxPortable/App/Firefox;								\
+		$(SEVENZIP) u -tzip omni.ja											\
+		chrome/en-US/locale/branding/browserconfig.properties);				\
+	rm -rf "$$CHROMEDIR"
+
 	## Set up alternate launcher
 	mv $(DEST)/FirefoxPortable/App/Firefox/firefox.exe $(DEST)/FirefoxPortable/App/Firefox/tbb-firefox.exe
 
@@ -367,8 +382,10 @@ compressed-bundle_%:
 	LANGCODE=$* make -f windows-alpha.mk compressed-bundle-localized
 
 bundle-localized_%.stamp:
-	make -f windows-alpha.mk copy-files_$* install-extensions install-torbutton install-httpseverywhere install-noscript install-pdfjs \
-	patch-vidalia-language patch-firefox-language patch-pidgin-language write-tbb-version
+	make -f windows-alpha.mk copy-files_$* install-extensions				\
+		install-torbutton install-httpseverywhere install-noscript			\
+		install-pdfjs patch-vidalia-language patch-firefox-config			\
+		patch-pidgin-language
 	touch $(STAMP_DIR)/bundle-localized_$*.stamp
 
 bundle-localized: bundle-localized_$(LANGCODE).stamp
@@ -391,6 +408,15 @@ install-extensions: $(filter-out langpack_en-US.xpi,langpack_$(LANGCODE).xpi)
 	mkdir -p $(BUNDLE)/FirefoxPortable/Data/profile/extensions
 ifneq ($(LANGCODE), en-US)
 	mv langpack_$(LANGCODE).xpi $(BUNDLE)/FirefoxPortable/Data/profile/extensions/langpack-$(LANGCODE)@firefox.mozilla.org.xpi
+	## Patch Firefox default home page within language pack
+	CHROMEDIR=$(BUNDLE)/FirefoxPortable/Data/profile/extensions/chrome;		\
+	mkdir -p "$$CHROMEDIR/$(LANGCODE)/locale/branding";						\
+	sed -e "s/SHPONKA/$(LANGCODE)/g" config/browserconfig.properties		\
+		> "$$CHROMEDIR/$(LANGCODE)/locale/branding/browserconfig.properties"; \
+	(cd $(BUNDLE)/FirefoxPortable/Data/profile/extensions;					\
+		$(SEVENZIP) u -tzip langpack-$(LANGCODE)@firefox.mozilla.org.xpi	\
+		chrome/$(LANGCODE)/locale/branding/browserconfig.properties);		\
+	rm -rf "$$CHROMEDIR"
 endif
 	rm -fr $(DUMMYPROFILE)
 
@@ -426,14 +452,19 @@ ifeq ($(USE_PIDGIN),1)
 				   $(BUNDLE)/PidginPortable/App/Pidgin/Gtk/share/locale
 endif
 
-patch-firefox-language:
-	## Patch Firefox prefs.js
-	./patch-firefox-language.sh $(BUNDLE)/FirefoxPortable/App/DefaultData/profile/prefs.js $(LANGCODE)
-	./patch-firefox-language.sh $(BUNDLE)/FirefoxPortable/Data/profile/prefs.js $(LANGCODE)
-	sed -i -e "s/SHPONKA/$(LANGCODE)/g" $(BUNDLE)/FirefoxPortable/Data/profile/prefs.js
-	sed -i -e "s/SHPONKA/$(LANGCODE)/g" $(BUNDLE)/FirefoxPortable/App/DefaultData/profile/prefs.js
-	chmod u+w $(BUNDLE)/FirefoxPortable/Data/profile/prefs.js
-	chmod u+w $(BUNDLE)/FirefoxPortable/App/DefaultData/profile/prefs.js
+patch-firefox-config:
+	## Patch Firefox default preferences by adding a patched #tor.js file:
+	PREFSDIR=$(BUNDLE)/FirefoxPortable/App/Firefox/defaults/preferences;	\
+	mkdir -p "$$PREFSDIR";													\
+	sed -e "s/SHPONKA/$(LANGCODE)/g" config/pound_tor.js					\
+		> "$$PREFSDIR/#tor.js";												\
+	./patch-firefox-language.sh "$$PREFSDIR/#tor.js" $(LANGCODE) -e;		\
+	printf 'pref("torbrowser.version", "%s");\n'							\
+			"$(RELEASE_VER)-$(BUILD_NUM)-$(PLATFORM)"						\
+			>> "$$PREFSDIR/#tor.js";										\
+	(cd $(BUNDLE)/FirefoxPortable/App/Firefox;								\
+			$(SEVENZIP) u -tzip omni.ja defaults/preferences/#tor.js);		\
+	rm -rf "$$PREFSDIR"
 
 ###
 ### Utilities
@@ -441,15 +472,12 @@ patch-firefox-language:
 
 ## Copy Firefox preferences from a run of FirefoxPortable to be the default
 apply-prefs:
-	cp $(DEST)/FirefoxPortable/Data/profile/prefs.js config
+	sed -e "s/^user_//" $(BUNDLE)/FirefoxPortable/Data/profile/prefs.js		\
+		> config/pound_tor.js
 
 print-version:
 	@echo $(RELEASE_VER)-$(BUILD_NUM)
 
-write-tbb-version:
-	printf 'user_pref("torbrowser.version", "%s");\n' "$(RELEASE_VER)-$(BUILD_NUM)-$(PLATFORM)" >> $(BUNDLE)/FirefoxPortable/App/DefaultData/profile/prefs.js
-	printf 'user_pref("torbrowser.version", "%s");\n' "$(RELEASE_VER)-$(BUILD_NUM)-$(PLATFORM)" >> $(BUNDLE)/FirefoxPortable/Data/profile/prefs.js
-
 ## Tag the release
 releasetag:
 	git tag -s torbrowser-$(VERSION) -m "tagging $(VERSION)"
diff --git a/src/current-patches/firefox/0007-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch b/src/current-patches/firefox/0007-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch
index 76c1aff..e83a0d2 100644
--- a/src/current-patches/firefox/0007-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch
+++ b/src/current-patches/firefox/0007-Make-Tor-Browser-exit-when-not-launched-from-Vidalia.patch
@@ -12,14 +12,14 @@ https://trac.torproject.org/projects/tor/ticket/4192. We can do a better
 localized fix w/ a translated alert menu later, if it seems like this might
 actually be common.
 ---
- browser/base/content/browser.js |   13 +++++++++++++
- 1 files changed, 13 insertions(+), 0 deletions(-)
+ browser/base/content/browser.js |   14 +++++++++++++
+ 1 files changed, 14 insertions(+), 0 deletions(-)
 
 diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
 index f46a33d..9f77fd0 100644
 --- a/browser/base/content/browser.js
 +++ b/browser/base/content/browser.js
-@@ -1093,6 +1093,19 @@ var gBrowserInit = {
+@@ -1096,6 +1096,20 @@ var gBrowserInit = {
      // setup simple gestures support
      gGestureSupport.init(true);
  
@@ -27,7 +27,8 @@ index f46a33d..9f77fd0 100644
 +    // Solves https://trac.torproject.org/projects/tor/ticket/4192
 +    var foundPref = false;
 +    try {
-+      foundPref = gPrefService.prefHasUserValue("torbrowser.version");
++      var ignored = gPrefService.getCharPref("torbrowser.version");
++      foundPref = true;
 +    } catch(e) {
 +      //dump("No pref: "+e);
 +    }





More information about the tor-commits mailing list