From 9cb421088905cba09d2a4f52b45ac07df3cb726c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rub=C3=A9n=20Rodr=C3=ADguez?= <ruben@trisquel.info>
Date: Mon, 16 Jun 2014 19:11:20 +0200
Subject: [PATCH] Updated firefox for v30, hardened privacy

---
 .../DATA/firefox/abouthome/aboutHome.xhtml    |  3 +-
 helpers/DATA/firefox/settings.js              | 43 ++++++++++++++-----
 helpers/make-firefox                          | 15 ++++---
 3 files changed, 43 insertions(+), 18 deletions(-)

diff --git a/helpers/DATA/firefox/abouthome/aboutHome.xhtml b/helpers/DATA/firefox/abouthome/aboutHome.xhtml
index 3115a48d..d121ace4 100644
--- a/helpers/DATA/firefox/abouthome/aboutHome.xhtml
+++ b/helpers/DATA/firefox/abouthome/aboutHome.xhtml
@@ -55,7 +55,8 @@ text-shadow:0px 1px 0px #fff;
       <img src="chrome://branding/content/about-logo.png"/>
 
       <div id="searchContainer">
-        <form name="searchForm" id="searchForm" action="https://duckduckgo.com/html">
+        <form name="searchForm" id="searchForm" action="https://duckduckgo.com/html/">
+          <input type="hidden" name="t" value="trisquel"/>
           <input type="text" name="q" value="" id="searchText" maxlength="256"
                  autofocus="autofocus"/>
           <input id="searchSubmit" type="submit" value="&abouthome.searchEngineButton.label;"/>
diff --git a/helpers/DATA/firefox/settings.js b/helpers/DATA/firefox/settings.js
index c51663f4..8b976a88 100644
--- a/helpers/DATA/firefox/settings.js
+++ b/helpers/DATA/firefox/settings.js
@@ -8,7 +8,7 @@ pref("pfs.datasource.url", "http://trisquel.info/sites/pfs.php?mime=%PLUGIN_MIME
 pref("pfs.filehint.url", "http://trisquel.info/sites/pfs.php?mime=%PLUGIN_MIMETYPE%");
 
 // I'm feeling Ducky.
-pref("keyword.URL", "https://duckduckgo.com/?t=trisquel&q=!+");
+pref("keyword.URL", "https://duckduckgo.com/html?t=trisquel&q=!+");
 pref("browser.search.defaultenginename", "DuckDuckGo (SSL)");
 pref("browser.search.order.extra.duckduckgo", "DuckDuckGo (SSL)");
 
@@ -17,11 +17,13 @@ pref("plugins.hide_infobar_for_missing_plugin", true);
 pref("plugins.hide_infobar_for_outdated_plugin", true);
 pref("plugins.notifyMissingFlash", false);
 
+//https://developer.mozilla.org/en-US/docs/Web/API/MediaSource
+//pref("media.mediasource.enabled",true);
+
 //Speeding it up
 pref("network.http.pipelining", true);
 pref("network.http.proxy.pipelining", true);
 pref("network.http.pipelining.maxrequests", 10);
-pref("network.dns.disableIPv6", true);
 pref("nglayout.initialpaint.delay", 0);
 
 // Disable third party cookies
@@ -39,19 +41,18 @@ pref("browser.EULA.override", true);
 // Default name strings
 pref ("distribution.about", "Abrowser for Trisquel");
 pref ("distribution.id", "trisquel");
-pref ("distribution.version", "$REVISION");
+pref ("distribution.version", "1.0");
 
-// UserAgeng
-pref("general.useragent.vendor", "Trisquel");
-pref("general.useragent.vendorComment", "$CODENAME");
-pref("general.useragent.vendorSub", "$REVISION");
 // Set useragent to Firefox compatible
-pref("general.useragent.compatMode.abrowser",true);
+pref("general.useragent.compatMode.firefox",true);
+// Spoof the useragent to a generic one
+//pref("general.useragent.override", "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0");
+
 
 // Startup pages
-pref ("browser.startup.page" , 3);
-pref ("browser.startup.homepage" , "http://trisquel.info");
-pref ("startup.homepage_welcome_url", "http://trisquel.info/welcome");
+//pref ("browser.startup.page" , 3);
+//pref ("browser.startup.homepage" , "http://trisquel.info");
+//pref ("startup.homepage_welcome_url", "http://trisquel.info/welcome");
 //pref ("startup.homepage_override_url" , "http://trisquel.info/newbrowser");
 
 // Preferences for the Get Add-ons panel
@@ -60,6 +61,8 @@ pref ("extensions.getAddons.search.url", "http://trisquel.info");
 
 // Help URL
 pref ("app.support.baseURL", "http://trisquel.info/wiki/");
+pref ("app.support.inputURL", "https://trisquel.info/contact");
+pref ("app.feedback.baseURL", "https://trisquel.info/contact");
 pref ("browser.uitour.url", "http://trisquel.info/browser");
 pref ("plugins.update.url", "http://trisquel.info/browser");
 pref ("browser.customizemode.tip0.learnMoreUrl", "http://trisquel.info/browser");
@@ -67,6 +70,8 @@ pref ("browser.customizemode.tip0.learnMoreUrl", "http://trisquel.info/browser")
 // Dictionary download preference
 pref("browser.dictionaries.download.url", "http://dictionaries.mozdev.org/");
 pref("browser.search.searchEnginesURL", "http://mycroft.mozdev.org/");
+// Enable Spell Checking In All Text Fields
+pref("layout.spellcheckDefault", 2);
 
 // Apturl preferences
 pref("network.protocol-handler.app.apt","/usr/bin/apturl");
@@ -77,7 +82,11 @@ pref("network.protocol-handler.external.apt",true);
 pref("network.protocol-handler.external.apt+http",true);
 
 // Privacy & Freedom Issues
+// https://webdevelopmentaid.wordpress.com/2013/10/21/customize-privacy-settings-in-mozilla-firefox-part-1-aboutconfig/
+// https://panopticlick.eff.org
+// https://wiki.mozilla.org/Fingerprinting
 pref("privacy.donottrackheader.enabled", true);
+pref("privacy.donottrackheader.value", 1);
 pref("dom.ipc.plugins.flash.subprocess.crashreporter.enabled", false);
 pref("browser.safebrowsing.enabled", false);
 pref("browser.safebrowsing.malware.enabled", false);
@@ -89,6 +98,18 @@ pref("social.toast-notifications.enabled", false);
 pref("datareporting.healthreport.uploadEnabled", false);
 pref("datareporting.healthreport.service.enabled", false);
 pref("browser.slowStartup.notificationDisabled", true);
+pref("network.http.sendRefererHeader", 0);
+//http://grack.com/blog/2010/01/06/3rd-party-cookies-dom-storage-and-privacy/
+//pref("dom.storage.enabled", false);
+pref("dom.event.clipboardevents.enabled",false);
+pref("network.prefetch-next", false);
+pref("network.dns.disablePrefetch", true);
+pref("network.http.sendSecureXSiteReferrer", false);
+pref("toolkit.telemetry.enabled", false);
+// Do not tell what plugins do we have enabled: https://mail.mozilla.org/pipermail/firefox-dev/2013-November/001186.html
+pref("plugins.enumerable_names", "");
+pref("plugin.state.flash", 1);
+
 
 // Services
 pref("gecko.handlerService.schemes.mailto.0.name", "");
diff --git a/helpers/make-firefox b/helpers/make-firefox
index b1a909cc..a8beda10 100644
--- a/helpers/make-firefox
+++ b/helpers/make-firefox
@@ -17,7 +17,7 @@
 #    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 #
 
-VERSION=22
+VERSION=27
 
 . ./config
 
@@ -44,8 +44,10 @@ sed 's%https://www.mozilla.org/legal/privacy/%https://trisquel.info/legal%' -i .
 #sed 's%https://www.mozilla.org/firefox/central/%https://trisquel.info/browser%' -i browser/base/content/browser-appmenu.inc
 
 # Enable gst support
-apt-get install -y --force-yes libgstreamermm-0.10-dev
-echo "ac_add_options --enable-gstreamer" >> debian/config/mozconfig.in
+[ $REVISION = "6.0" ] && apt-get install -y --force-yes libgstreamermm-0.10-dev
+[ $REVISION = "6.0" ] && echo "ac_add_options --enable-gstreamer=0.10" >> debian/config/mozconfig.in
+[ $REVISION = "7.0" ] && echo "ac_add_options --enable-gstreamer=1.0" >> debian/config/mozconfig.in
+sed 's/1204/60/g; s/1210/65/g; s/1404/70/g' -i debian/config/mozconfig.in debian/firefox-dev.install.in debian/firefox-dev.links.in
 
 sed 's/com.ubuntu/org.trisquel/' -i debian/config/mozconfig.in
 
@@ -64,7 +66,7 @@ find debian/searchplugins |grep amazon| xargs -i /bin/sed '/canoniccom/d;' -i {}
 replace "mozilla.com/plugincheck" "trisquel.info/browser" .
 
 # contact link
-sed 's_https://input.mozilla.org/feedback_https://trisquel.info/contact_' -i browser/base/content/utilityOverlay.js
+#sed 's_https://input.mozilla.org/feedback_https://trisquel.info/contact_' -i browser/base/content/utilityOverlay.js
 
 cat << EOF > debian/distribution.ini
 [Global]
@@ -107,6 +109,7 @@ replace "Replaces: abrowser" "Replaces: firefox" .
 #sed s/Ubuntu/Trisquel/g debian/rules -i
 sed s/ubuntu/trisquel/g debian/distribution.ini -i
 sed 's/ubuntu_version/trisquel_version/; s/Ubuntu 10.10/Trisquel 4.0/; s/1010/40/' -i debian/abrowser.postinst.in
+replace "Adobe Flash" "Flash" .
 
 # abrowser-dev should provide firefox-dev
 sed '/Package: @MOZ_PKG_NAME@-dev/,/Description:/ s/Provides:/Provides:firefox-dev, /' debian/control.in -i
@@ -143,7 +146,7 @@ cat << EOF > debian/search/duckduckgo.xml
 <os:Description>Search DuckDuckGo</os:Description>
 <os:InputEncoding>UTF-8</os:InputEncoding>
 <os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAANcNAADXDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJyDsJmlk8pf6+v3s/v7+++zr/fcnIOyzJyDsgCcg7CYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnIOwBJyDscCcg7PZttJ7/7Pfs//////++xO7/S5GA/ycg7P8nIOz2JyDscCcg7AEAAAAAAAAAAAAAAAAnIOwBJyDstScg7P8nIOz/Y8p5/2fHZf9Yv0z/YcF2/1rBUv8nIOz/JyDs/ycg7P8nIOy1JyDsAQAAAAAAAAAAJyDscCcg7P8nIOz/JyDs/4jQoP/p9+n//////05X3v9LkYD/JyDs/ycg7P8nIOz/JyDs/ycg7HAAAAAAJyDsJicg7PYnIOz/JyDs/zUu7f/+/v////////////89N+7/JyDs/yUo7f8nIOz/JyDs/ycg7P8nIOz2JyDsJicg7IAnIOz/JyDs/ycg7P9hXPH////////////t/P//GIr2/wfD+/8Gyfz/DKv5/yM57/8nIOz/JyDs/ycg7H8nIOyzJyDs/ycg7P8nIOz/jov1////////////Otz9/w3G/P8cWfH/JSvt/ycg7P8nIOz/JyDs/ycg7P8nIOyzJyDs5icg7P8nIOz/JyDs/7u5+f///////////27l/v8E0v3/BNL9/wTQ/f8Oofn/IT7v/ycg7P8nIOz/JyDs5icg7OYnIOz/JyDs/ycg7P/p6P3/uWsC////////////5fr//6Po/f8Thfb/DKv5/w6f+f8nIOz/JyDs/ycg7OYnIOyzJyDs/ycg7P8nIOz/9/b+/////////////////7lrAv/V1Pv/JyDs/ycg7P8nIOz/JyDs/ycg7P8nIOyzJyDsgCcg7P8nIOz/JyDs/8/N+///////////////////////iIX1/ycg7P8nIOz/JyDs/ycg7P8nIOz/JyDsfycg7CYnIOz2JyDs/ycg7P9FP+7/q6n4/+7u/f/n5v3/fXn0/yoj7P8nIOz/JyDs/ycg7P8nIOz/JyDs9icg7CYAAAAAJyDscCcg7P8nIOz/wsD6/+no/f/Y1/z/eHTz/ycg7P8nIOz/JyDs/ycg7P8nIOz/JyDs/ycg7HAAAAAAAAAAACcg7AEnIOy1JyDs/ycg7P8nIOz/JyDs/ycg7P8nIOz/JyDs/ycg7P8nIOz/JyDs/ycg7LUnIOwBAAAAAAAAAAAAAAAAJyDsAScg7HAnIOz2JyDs/ycg7P8nIOz/JyDs/ycg7P8nIOz/JyDs9icg7HAnIOwBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJyDsJicg7IAnIOyzJyDs5icg7OYnIOyzJyDsgCcg7CYAAAAAAAAAAAAAAAAAAAAA+B8AAPAPAADAAwAAwAMAAIABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAACAAQAAwAMAAMADAADwDwAA+B8AAA==</os:Image>
-<os:Url type="text/html" method="GET" template="http://duckduckgo.com/?t=trisquel&amp;q={searchTerms}">
+<os:Url type="text/html" method="GET" template="http://duckduckgo.com/html?t=trisquel&amp;q={searchTerms}">
 </os:Url>
 </SearchPlugin>
 EOF
@@ -154,7 +157,7 @@ cat << EOF > debian/search/duckduckgo-ssl.xml
 <os:Description>Search DuckDuckGo (SSL)</os:Description>
 <os:InputEncoding>UTF-8</os:InputEncoding>
 <os:Image width="16" height="16">data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAANcNAADXDQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJyDsJmlk8pf6+v3s/v7+++zr/fcnIOyzJyDsgCcg7CYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnIOwBJ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Ds/ycg7P8nIOz/JyDs/ycg7P8nIOz/JyDs9icg7HAnIOwBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJyDsJicg7IAnIOyzJyDs5icg7OYnIOyzJyDsgCcg7CYAAAAAAAAAAAAAAAAAAAAA+B8AAPAPAADAAwAAwAMAAIABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAACAAQAAwAMAAMADAADwDwAA+B8AAA==</os:Image>
-<os:Url type="text/html" method="GET" template="https://duckduckgo.com/?t=trisquel&amp;q={searchTerms}">
+<os:Url type="text/html" method="GET" template="https://duckduckgo.com/html?t=trisquel&amp;q={searchTerms}">
 </os:Url>
 </SearchPlugin>
 EOF
-- 
GitLab