From 81cda5c8b9c43955d4d51c6c63def5353430d2d9 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Sat, 21 Dec 2013 17:06:58 -0200 Subject: iceweasel-libre: add more fixes on libre.patch, remove extra contents due instability --- libre/iceweasel-libre/PKGBUILD | 2 +- libre/iceweasel-libre/libre.patch | 378 ++++++++++--- libre/iceweasel-libre/libre.patch.goal | 935 +++++++++++++++++++++++++++++++++ 3 files changed, 1233 insertions(+), 82 deletions(-) create mode 100644 libre/iceweasel-libre/libre.patch.goal (limited to 'libre/iceweasel-libre') diff --git a/libre/iceweasel-libre/PKGBUILD b/libre/iceweasel-libre/PKGBUILD index 56d83e225..043e68da8 100644 --- a/libre/iceweasel-libre/PKGBUILD +++ b/libre/iceweasel-libre/PKGBUILD @@ -64,7 +64,7 @@ md5sums=('219cf21e0642e8a364365286f23d0624' '2001d0477bcefd0eeaab584402133691' '023120a970670dc85cea19393f0b94b6' 'df08eaa1ac3bc6c2356be4fbf8ec8932' - '02a8b86b3d528770de28276cc98afa17' + '6df26fc131b88c9ec894757681e7f6a6' 'b03a979a78484503ba8dddad4f2c96d1' '7b9e5996dd9fe0b186a43a297db1c6b5' '6620e724ec9a1be74e65089d81d802f7' diff --git a/libre/iceweasel-libre/libre.patch b/libre/iceweasel-libre/libre.patch index 7555cc8c4..ced25fcc5 100644 --- a/libre/iceweasel-libre/libre.patch +++ b/libre/iceweasel-libre/libre.patch @@ -1,8 +1,20 @@ diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js -index 331edc8..e18bd20 100644 +index 331edc8..226508d 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js -@@ -1283,14 +1283,6 @@ pref("pdfjs.previousHandler.alwaysAskBeforeHandling", false); +@@ -242,11 +242,6 @@ pref("browser.slowStartup.notificationDisabled", false); + pref("browser.slowStartup.timeThreshold", 60000); + pref("browser.slowStartup.maxSamples", 5); + +-// This url, if changed, MUST continue to point to an https url. Pulling arbitrary content to inject into +-// this page over http opens us up to a man-in-the-middle attack that we'd rather not face. If you are a downstream +-// repackager of this code using an alternate snippet url, please keep your users safe +-pref("browser.aboutHomeSnippets.updateUrl", "https://snippets.mozilla.com/%STARTPAGE_VERSION%/%NAME%/%VERSION%/%APPBUILDID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/"); +- + pref("browser.enable_automatic_image_resizing", true); + pref("browser.chrome.site_icons", true); + pref("browser.chrome.favicons", true); +@@ -1283,11 +1278,7 @@ pref("pdfjs.previousHandler.alwaysAskBeforeHandling", false); // (This is intentionally on the high side; see bug 746055.) pref("image.mem.max_decoded_image_kb", 256000); @@ -11,17 +23,15 @@ index 331edc8..e18bd20 100644 - -pref("social.sidebar.open", true); -pref("social.sidebar.unload_timeout_ms", 10000); -- --pref("dom.identity.enabled", false); -- - // Turn on the CSP 1.0 parser for Content Security Policy headers - pref("security.csp.speccompliant", true); ++// removed facebook sidebar with Iceweasel. + + pref("dom.identity.enabled", false); diff --git a/browser/base/content/abouthome/aboutHome.css b/browser/base/content/abouthome/aboutHome.css -index c270318..5175eaa 100644 +index c270318..d4ecde0 100644 --- a/browser/base/content/abouthome/aboutHome.css +++ b/browser/base/content/abouthome/aboutHome.css -@@ -49,11 +49,6 @@ a { +@@ -49,15 +49,6 @@ a { background-repeat: no-repeat; } @@ -30,10 +40,14 @@ index c270318..5175eaa 100644 - width: 470px; -} - - #searchForm { +-#searchForm { +- display: -moz-box; +-} +- + #searchLogoContainer { display: -moz-box; - } -@@ -72,8 +67,7 @@ a { + -moz-box-align: center; +@@ -72,8 +63,7 @@ a { #searchEngineLogo { display: inline-block; height: 28px; @@ -43,7 +57,7 @@ index c270318..5175eaa 100644 } #searchText { -@@ -145,48 +139,6 @@ a { +@@ -145,48 +135,6 @@ a { transition-duration: 0ms; } @@ -92,16 +106,16 @@ index c270318..5175eaa 100644 #launcher { display: -moz-box; -moz-box-align: center; -@@ -335,7 +287,7 @@ body[narrow] #restorePreviousSession::before { +@@ -335,26 +283,25 @@ body[narrow] #restorePreviousSession::before { width: 32px; } -#aboutMozilla { +#aboutGNU { display: block; - position: relative; /* pin wordmark to edge of document, not of viewport */ +- position: relative; /* pin wordmark to edge of document, not of viewport */ -moz-box-ordinal-group: 0; -@@ -343,18 +295,18 @@ body[narrow] #restorePreviousSession::before { + opacity: .5; transition: opacity 150ms; } @@ -125,7 +139,7 @@ index c270318..5175eaa 100644 } /* [HiDPI] -@@ -366,22 +318,8 @@ body[narrow] #restorePreviousSession::before { +@@ -366,26 +313,6 @@ body[narrow] #restorePreviousSession::before { background-image: url("chrome://branding/content/about-logo@2x.png"); } @@ -143,21 +157,23 @@ index c270318..5175eaa 100644 - background-image: url("chrome://browser/content/abouthome/snippet2@2x.png"); - } - - .launchButton::before, +- .launchButton::before, - #aboutMozilla::before { -+ #aboutGNU::before { - transform: scale(.5); - transform-origin: 0 0; +- transform: scale(.5); +- transform-origin: 0 0; +- } +- + #downloads::before { + content: url("chrome://browser/content/abouthome/downloads@2x.png"); } -@@ -422,8 +360,8 @@ body[narrow] #restorePreviousSession::before { +@@ -421,9 +348,5 @@ body[narrow] #restorePreviousSession::before { + body[narrow] #restorePreviousSession::before { content: url("chrome://browser/content/abouthome/restore@2x.png"); } - +- - #aboutMozilla::before { - content: url("chrome://browser/content/abouthome/mozilla@2x.png"); -+ #aboutGNU::before { -+ content: url("chrome://browser/content/abouthome/gnu_headshadow.png"); - } +- } } diff --git a/browser/base/content/abouthome/aboutHome.js b/browser/base/content/abouthome/aboutHome.js @@ -727,10 +743,10 @@ index 432fcdc..8e85f1f 100644 function fitToWidth() { diff --git a/browser/base/content/abouthome/aboutHome.xhtml b/browser/base/content/abouthome/aboutHome.xhtml -index 1d03d38..4f9b6b2 100644 +index 1d03d38..fda3095 100644 --- a/browser/base/content/abouthome/aboutHome.xhtml +++ b/browser/base/content/abouthome/aboutHome.xhtml -@@ -43,15 +43,6 @@ +@@ -43,30 +43,9 @@ @@ -746,15 +762,264 @@ index 1d03d38..4f9b6b2 100644
-@@ -66,7 +57,6 @@ -
- -
+-
+- +- +- +- +- +- +- +-
+- +-
- - + +diff --git a/browser/base/content/content.js b/browser/base/content/content.js +index 9428613..fc3c00a 100644 +--- a/browser/base/content/content.js ++++ b/browser/base/content/content.js +@@ -50,216 +50,3 @@ if (Services.prefs.getBoolPref("browser.tabs.remote")) { + LoginManagerContent.onUsernameInput(event); + }); + } +- +-let AboutHomeListener = { +- init: function(chromeGlobal) { +- chromeGlobal.addEventListener('AboutHomeLoad', () => this.onPageLoad(), false, true); +- }, +- +- handleEvent: function(aEvent) { +- switch (aEvent.type) { +- case "AboutHomeLoad": +- this.onPageLoad(); +- break; +- } +- }, +- +- receiveMessage: function(aMessage) { +- switch (aMessage.name) { +- case "AboutHome:Update": +- this.onUpdate(aMessage.data); +- break; +- } +- }, +- +- onUpdate: function(aData) { +- let doc = content.document; +- if (doc.documentURI.toLowerCase() != "about:home") +- return; +- +- if (aData.showRestoreLastSession && !PrivateBrowsingUtils.isWindowPrivate(content)) +- doc.getElementById("launcher").setAttribute("session", "true"); +- +- // Inject search engine and snippets URL. +- let docElt = doc.documentElement; +- // set the following attributes BEFORE searchEngineName, which triggers to +- // show the snippets when it's set. +- docElt.setAttribute("snippetsURL", aData.snippetsURL); +- if (aData.showKnowYourRights) +- docElt.setAttribute("showKnowYourRights", "true"); +- docElt.setAttribute("snippetsVersion", aData.snippetsVersion); +- docElt.setAttribute("searchEngineName", Services.search.defaultEngine.name); +- }, +- +- onPageLoad: function() { +- let doc = content.document; +- if (doc.documentURI.toLowerCase() != "about:home" || +- doc.documentElement.hasAttribute("hasBrowserHandlers")) { +- return; +- } +- +- doc.documentElement.setAttribute("hasBrowserHandlers", "true"); +- let updateListener = this; +- addMessageListener("AboutHome:Update", updateListener); +- addEventListener("click", this.onClick, true); +- addEventListener("pagehide", function onPageHide(event) { +- if (event.target.defaultView.frameElement) +- return; +- removeMessageListener("AboutHome:Update", updateListener); +- removeEventListener("click", this.onClick, true); +- removeEventListener("pagehide", onPageHide, true); +- if (event.target.documentElement) +- event.target.documentElement.removeAttribute("hasBrowserHandlers"); +- }, true); +- +- // XXX bug 738646 - when Marketplace is launched, remove this statement and +- // the hidden attribute set on the apps button in aboutHome.xhtml +- if (Services.prefs.getPrefType("browser.aboutHome.apps") == Services.prefs.PREF_BOOL && +- Services.prefs.getBoolPref("browser.aboutHome.apps")) +- doc.getElementById("apps").removeAttribute("hidden"); +- +- sendAsyncMessage("AboutHome:RequestUpdate"); +- +- doc.addEventListener("AboutHomeSearchEvent", function onSearch(e) { +- sendAsyncMessage("AboutHome:Search", { searchData: e.detail }); +- }, true, true); +- }, +- +- onClick: function(aEvent) { +- if (!aEvent.isTrusted || // Don't trust synthetic events +- aEvent.button == 2 || aEvent.target.localName != "button") { +- return; +- } +- +- let originalTarget = aEvent.originalTarget; +- let ownerDoc = originalTarget.ownerDocument; +- let elmId = originalTarget.getAttribute("id"); +- +- switch (elmId) { +- case "restorePreviousSession": +- sendAsyncMessage("AboutHome:RestorePreviousSession"); +- ownerDoc.getElementById("launcher").removeAttribute("session"); +- break; +- +- case "downloads": +- sendAsyncMessage("AboutHome:Downloads"); +- break; +- +- case "bookmarks": +- sendAsyncMessage("AboutHome:Bookmarks"); +- break; +- +- case "history": +- sendAsyncMessage("AboutHome:History"); +- break; +- +- case "apps": +- sendAsyncMessage("AboutHome:Apps"); +- break; +- +- case "addons": +- sendAsyncMessage("AboutHome:Addons"); +- break; +- +- case "sync": +- sendAsyncMessage("AboutHome:Sync"); +- break; +- +- case "settings": +- sendAsyncMessage("AboutHome:Settings"); +- break; +- } +- }, +-}; +-AboutHomeListener.init(this); +- +- +-var global = this; +- +-let ClickEventHandler = { +- init: function init() { +- Cc["@mozilla.org/eventlistenerservice;1"] +- .getService(Ci.nsIEventListenerService) +- .addSystemEventListener(global, "click", this, true); +- }, +- +- handleEvent: function(event) { +- // Bug 903016: Most of this code is an unfortunate duplication from +- // contentAreaClick in browser.js. +- if (!event.isTrusted || event.defaultPrevented || event.button == 2) +- return; +- +- let [href, node] = this._hrefAndLinkNodeForClickEvent(event); +- +- let json = { button: event.button, shiftKey: event.shiftKey, +- ctrlKey: event.ctrlKey, metaKey: event.metaKey, +- altKey: event.altKey, href: null, title: null, +- bookmark: false }; +- +- if (href) { +- json.href = href; +- if (node) { +- json.title = node.getAttribute("title"); +- +- if (event.button == 0 && !event.ctrlKey && !event.shiftKey && +- !event.altKey && !event.metaKey) { +- json.bookmark = node.getAttribute("rel") == "sidebar"; +- if (json.bookmark) +- event.preventDefault(); // Need to prevent the pageload. +- } +- } +- +- sendAsyncMessage("Content:Click", json); +- return; +- } +- +- // This might be middle mouse navigation. +- if (event.button == 1) +- sendAsyncMessage("Content:Click", json); +- }, +- +- /** +- * Extracts linkNode and href for the current click target. +- * +- * @param event +- * The click event. +- * @return [href, linkNode]. +- * +- * @note linkNode will be null if the click wasn't on an anchor +- * element (or XLink). +- */ +- _hrefAndLinkNodeForClickEvent: function(event) { +- function isHTMLLink(aNode) { +- // Be consistent with what nsContextMenu.js does. +- return ((aNode instanceof content.HTMLAnchorElement && aNode.href) || +- (aNode instanceof content.HTMLAreaElement && aNode.href) || +- aNode instanceof content.HTMLLinkElement); +- } +- +- let node = event.target; +- while (node && !isHTMLLink(node)) { +- node = node.parentNode; +- } +- +- if (node) +- return [node.href, node]; +- +- // If there is no linkNode, try simple XLink. +- let href, baseURI; +- node = event.target; +- while (node && !href) { +- if (node.nodeType == content.Node.ELEMENT_NODE) { +- href = node.getAttributeNS("http://www.w3.org/1999/xlink", "href"); +- if (href) +- baseURI = node.ownerDocument.baseURIObject; +- } +- node = node.parentNode; +- } +- +- // In case of XLink, we don't return the node we got href from since +- // callers expect -like elements. +- // Note: makeURI() will throw if aUri is not a valid URI. +- return [href ? makeURI(href, null, baseURI).spec : null, null]; +- } +-}; +-ClickEventHandler.init(); +diff --git a/browser/base/jar.mn b/browser/base/jar.mn +index f2a820c..9478039 100644 +--- a/browser/base/jar.mn ++++ b/browser/base/jar.mn +@@ -33,7 +33,7 @@ browser.jar: + content/browser/abouthome/settings.png (content/abouthome/settings.png) + content/browser/abouthome/restore.png (content/abouthome/restore.png) + content/browser/abouthome/restore-large.png (content/abouthome/restore-large.png) +- content/browser/abouthome/mozilla.png (content/abouthome/mozilla.png) ++ content/browser/abouthome/gnu_headshadow.png (content/abouthome/gnu_headshadow.png) + content/browser/abouthome/snippet1@2x.png (content/abouthome/snippet1@2x.png) + content/browser/abouthome/snippet2@2x.png (content/abouthome/snippet2@2x.png) + content/browser/abouthome/downloads@2x.png (content/abouthome/downloads@2x.png) +@@ -45,7 +45,6 @@ browser.jar: + content/browser/abouthome/settings@2x.png (content/abouthome/settings@2x.png) + content/browser/abouthome/restore@2x.png (content/abouthome/restore@2x.png) + content/browser/abouthome/restore-large@2x.png (content/abouthome/restore-large@2x.png) +- content/browser/abouthome/mozilla@2x.png (content/abouthome/mozilla@2x.png) + #ifdef MOZ_SERVICES_HEALTHREPORT + content/browser/abouthealthreport/abouthealth.xhtml (content/abouthealthreport/abouthealth.xhtml) + content/browser/abouthealthreport/abouthealth.js (content/abouthealthreport/abouthealth.js) diff --git a/browser/locales/en-US/chrome/browser/aboutHome.dtd b/browser/locales/en-US/chrome/browser/aboutHome.dtd index e84341f..5476d32 100644 --- a/browser/locales/en-US/chrome/browser/aboutHome.dtd @@ -957,52 +1222,3 @@ index 98c443d..0173762 100644 if (target) { target.messageManager.sendAsyncMessage("AboutHome:Update", data); } else { -diff --git a/dom/ipc/test.xul b/dom/ipc/test.xul -index 3eede17..1b47a70 100644 ---- a/dom/ipc/test.xul -+++ b/dom/ipc/test.xul -@@ -302,6 +302,6 @@ - oncommand="document.getElementById('page').QueryInterface(Components.interfaces.nsIFrameLoaderOwner).frameLoader.delayRemoteDialogs = this.checked;"/> - - -- -+ - part of the snippet will be linked to the corresponding url. +-const DEFAULT_SNIPPETS_URLS = [ +- "https://www.mozilla.org/firefox/features/?utm_source=snippet&utm_medium=snippet&utm_campaign=default+feature+snippet" +-, "https://addons.mozilla.org/firefox/?utm_source=snippet&utm_medium=snippet&utm_campaign=addons" +-]; +- +-const SNIPPETS_UPDATE_INTERVAL_MS = 86400000; // 1 Day. +- +-// IndexedDB storage constants. +-const DATABASE_NAME = "abouthome"; +-const DATABASE_VERSION = 1; +-const SNIPPETS_OBJECTSTORE_NAME = "snippets"; +- + // This global tracks if the page has been set up before, to prevent double inits + let gInitialized = false; + let gObserver = new MutationObserver(function (mutations) { +@@ -156,7 +48,6 @@ let gObserver = new MutationObserver(function (mutations) { + if (mutation.attributeName == "searchEngineName") { + setupSearchEngine(); + if (!gInitialized) { +- ensureSnippetsMapThen(loadSnippets); + gInitialized = true; + } + return; +@@ -170,10 +61,6 @@ window.addEventListener("pageshow", function () { + window.gObserver.observe(document.documentElement, { attributes: true }); + fitToWidth(); + window.addEventListener("resize", fitToWidth); +- +- // Ask chrome to update snippets. +- var event = new CustomEvent("AboutHomeLoad", {bubbles:true}); +- document.dispatchEvent(event); + }); + + window.addEventListener("pagehide", function() { +@@ -181,117 +68,6 @@ window.addEventListener("pagehide", function() { + window.removeEventListener("resize", fitToWidth); + }); + +-// This object has the same interface as Map and is used to store and retrieve +-// the snippets data. It is lazily initialized by ensureSnippetsMapThen(), so +-// be sure its callback returned before trying to use it. +-let gSnippetsMap; +-let gSnippetsMapCallbacks = []; +- +-/** +- * Ensure the snippets map is properly initialized. +- * +- * @param aCallback +- * Invoked once the map has been initialized, gets the map as argument. +- * @note Snippets should never directly manage the underlying storage, since +- * it may change inadvertently. +- */ +-function ensureSnippetsMapThen(aCallback) +-{ +- if (gSnippetsMap) { +- aCallback(gSnippetsMap); +- return; +- } +- +- // Handle multiple requests during the async initialization. +- gSnippetsMapCallbacks.push(aCallback); +- if (gSnippetsMapCallbacks.length > 1) { +- // We are already updating, the callbacks will be invoked when done. +- return; +- } +- +- let invokeCallbacks = function () { +- if (!gSnippetsMap) { +- gSnippetsMap = Object.freeze(new Map()); +- } +- +- for (let callback of gSnippetsMapCallbacks) { +- callback(gSnippetsMap); +- } +- gSnippetsMapCallbacks.length = 0; +- } +- +- let openRequest = indexedDB.open(DATABASE_NAME, DATABASE_VERSION); +- +- openRequest.onerror = function (event) { +- // Try to delete the old database so that we can start this process over +- // next time. +- indexedDB.deleteDatabase(DATABASE_NAME); +- invokeCallbacks(); +- }; +- +- openRequest.onupgradeneeded = function (event) { +- let db = event.target.result; +- if (!db.objectStoreNames.contains(SNIPPETS_OBJECTSTORE_NAME)) { +- db.createObjectStore(SNIPPETS_OBJECTSTORE_NAME); +- } +- } +- +- openRequest.onsuccess = function (event) { +- let db = event.target.result; +- +- db.onerror = function (event) { +- invokeCallbacks(); +- } +- +- db.onversionchange = function (event) { +- event.target.close(); +- invokeCallbacks(); +- } +- +- let cache = new Map(); +- let cursorRequest = db.transaction(SNIPPETS_OBJECTSTORE_NAME) +- .objectStore(SNIPPETS_OBJECTSTORE_NAME).openCursor(); +- cursorRequest.onerror = function (event) { +- invokeCallbacks(); +- } +- +- cursorRequest.onsuccess = function(event) { +- let cursor = event.target.result; +- +- // Populate the cache from the persistent storage. +- if (cursor) { +- cache.set(cursor.key, cursor.value); +- cursor.continue(); +- return; +- } +- +- // The cache has been filled up, create the snippets map. +- gSnippetsMap = Object.freeze({ +- get: function (aKey) cache.get(aKey), +- set: function (aKey, aValue) { +- db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite") +- .objectStore(SNIPPETS_OBJECTSTORE_NAME).put(aValue, aKey); +- return cache.set(aKey, aValue); +- }, +- has: function (aKey) cache.has(aKey), +- delete: function (aKey) { +- db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite") +- .objectStore(SNIPPETS_OBJECTSTORE_NAME).delete(aKey); +- return cache.delete(aKey); +- }, +- clear: function () { +- db.transaction(SNIPPETS_OBJECTSTORE_NAME, "readwrite") +- .objectStore(SNIPPETS_OBJECTSTORE_NAME).clear(); +- return cache.clear(); +- }, +- get size() cache.size +- }); +- +- setTimeout(invokeCallbacks, 0); +- } +- } +-} +- + function onSearchSubmit(aEvent) + { + let searchTerms = document.getElementById("searchText").value; +@@ -341,156 +117,6 @@ function setupSearchEngine() + + } + +-/** +- * Inform the test harness that we're done loading the page. +- */ +-function loadSucceeded() +-{ +- var event = new CustomEvent("AboutHomeLoadSnippetsSucceeded", {bubbles:true}); +- document.dispatchEvent(event); +-} +- +-/** +- * Update the local snippets from the remote storage, then show them through +- * showSnippets. +- */ +-function loadSnippets() +-{ +- if (!gSnippetsMap) +- throw new Error("Snippets map has not properly been initialized"); +- +- // Allow tests to modify the snippets map before using it. +- var event = new CustomEvent("AboutHomeLoadSnippets", {bubbles:true}); +- document.dispatchEvent(event); +- +- // Check cached snippets version. +- let cachedVersion = gSnippetsMap.get("snippets-cached-version") || 0; +- let currentVersion = document.documentElement.getAttribute("snippetsVersion"); +- if (cachedVersion < currentVersion) { +- // The cached snippets are old and unsupported, restart from scratch. +- gSnippetsMap.clear(); +- } +- +- // Check last snippets update. +- let lastUpdate = gSnippetsMap.get("snippets-last-update"); +- let updateURL = document.documentElement.getAttribute("snippetsURL"); +- let shouldUpdate = !lastUpdate || +- Date.now() - lastUpdate > SNIPPETS_UPDATE_INTERVAL_MS; +- if (updateURL && shouldUpdate) { +- // Try to update from network. +- let xhr = new XMLHttpRequest(); +- try { +- xhr.open("GET", updateURL, true); +- } catch (ex) { +- showSnippets(); +- loadSucceeded(); +- return; +- } +- // Even if fetching should fail we don't want to spam the server, thus +- // set the last update time regardless its results. Will retry tomorrow. +- gSnippetsMap.set("snippets-last-update", Date.now()); +- xhr.onerror = function (event) { +- showSnippets(); +- }; +- xhr.onload = function (event) +- { +- if (xhr.status == 200) { +- gSnippetsMap.set("snippets", xhr.responseText); +- gSnippetsMap.set("snippets-cached-version", currentVersion); +- } +- showSnippets(); +- loadSucceeded(); +- }; +- xhr.send(null); +- } else { +- showSnippets(); +- loadSucceeded(); +- } +-} +- +-/** +- * Shows locally cached remote snippets, or default ones when not available. +- * +- * @note: snippets should never invoke showSnippets(), or they may cause +- * a "too much recursion" exception. +- */ +-let _snippetsShown = false; +-function showSnippets() +-{ +- let snippetsElt = document.getElementById("snippets"); +- +- // Show about:rights notification, if needed. +- let showRights = document.documentElement.getAttribute("showKnowYourRights"); +- if (showRights) { +- let rightsElt = document.getElementById("rightsSnippet"); +- let anchor = rightsElt.getElementsByTagName("a")[0]; +- anchor.href = "about:rights"; +- snippetsElt.appendChild(rightsElt); +- rightsElt.removeAttribute("hidden"); +- return; +- } +- +- if (!gSnippetsMap) +- throw new Error("Snippets map has not properly been initialized"); +- if (_snippetsShown) { +- // There's something wrong with the remote snippets, just in case fall back +- // to the default snippets. +- showDefaultSnippets(); +- throw new Error("showSnippets should never be invoked multiple times"); +- } +- _snippetsShown = true; +- +- let snippets = gSnippetsMap.get("snippets"); +- // If there are remotely fetched snippets, try to to show them. +- if (snippets) { +- // Injecting snippets can throw if they're invalid XML. +- try { +- snippetsElt.innerHTML = snippets; +- // Scripts injected by innerHTML are inactive, so we have to relocate them +- // through DOM manipulation to activate their contents. +- Array.forEach(snippetsElt.getElementsByTagName("script"), function(elt) { +- let relocatedScript = document.createElement("script"); +- relocatedScript.type = "text/javascript;version=1.8"; +- relocatedScript.text = elt.text; +- elt.parentNode.replaceChild(relocatedScript, elt); +- }); +- return; +- } catch (ex) { +- // Bad content, continue to show default snippets. +- } +- } +- +- showDefaultSnippets(); +-} +- +-/** +- * Clear snippets element contents and show default snippets. +- */ +-function showDefaultSnippets() +-{ +- // Clear eventual contents... +- let snippetsElt = document.getElementById("snippets"); +- snippetsElt.innerHTML = ""; +- +- // ...then show default snippets. +- let defaultSnippetsElt = document.getElementById("defaultSnippets"); +- let entries = defaultSnippetsElt.querySelectorAll("span"); +- // Choose a random snippet. Assume there is always at least one. +- let randIndex = Math.floor(Math.random() * entries.length); +- let entry = entries[randIndex]; +- // Inject url in the eventual link. +- if (DEFAULT_SNIPPETS_URLS[randIndex]) { +- let links = entry.getElementsByTagName("a"); +- // Default snippets can have only one link, otherwise something is messed +- // up in the translation. +- if (links.length == 1) { +- links[0].href = DEFAULT_SNIPPETS_URLS[randIndex]; +- } +- } +- // Move the default snippet to the snippets element. +- snippetsElt.appendChild(entry); +-} +- + function fitToWidth() { + if (window.scrollMaxX) { + document.body.setAttribute("narrow", "true"); +diff --git a/browser/base/content/abouthome/aboutHome.xhtml b/browser/base/content/abouthome/aboutHome.xhtml +index 1d03d38..4f9b6b2 100644 +--- a/browser/base/content/abouthome/aboutHome.xhtml ++++ b/browser/base/content/abouthome/aboutHome.xhtml +@@ -43,15 +43,6 @@ + + +
+- +-
+- +- +-
+-
+
+
+ +@@ -66,7 +57,6 @@ +
+ +
+- +-
++ + + +diff --git a/browser/base/content/content.js b/browser/base/content/content.js +index 9428613..ba010f3 100644 +--- a/browser/base/content/content.js ++++ b/browser/base/content/content.js +@@ -80,14 +80,8 @@ let AboutHomeListener = { + if (aData.showRestoreLastSession && !PrivateBrowsingUtils.isWindowPrivate(content)) + doc.getElementById("launcher").setAttribute("session", "true"); + +- // Inject search engine and snippets URL. ++ // Inject search engine. + let docElt = doc.documentElement; +- // set the following attributes BEFORE searchEngineName, which triggers to +- // show the snippets when it's set. +- docElt.setAttribute("snippetsURL", aData.snippetsURL); +- if (aData.showKnowYourRights) +- docElt.setAttribute("showKnowYourRights", "true"); +- docElt.setAttribute("snippetsVersion", aData.snippetsVersion); + docElt.setAttribute("searchEngineName", Services.search.defaultEngine.name); + }, + +diff --git a/browser/base/jar.mn b/browser/base/jar.mn +index f2a820c..9478039 100644 +--- a/browser/base/jar.mn ++++ b/browser/base/jar.mn +@@ -33,7 +33,7 @@ browser.jar: + content/browser/abouthome/settings.png (content/abouthome/settings.png) + content/browser/abouthome/restore.png (content/abouthome/restore.png) + content/browser/abouthome/restore-large.png (content/abouthome/restore-large.png) +- content/browser/abouthome/mozilla.png (content/abouthome/mozilla.png) ++ content/browser/abouthome/gnu_headshadow.png (content/abouthome/gnu_headshadow.png) + content/browser/abouthome/snippet1@2x.png (content/abouthome/snippet1@2x.png) + content/browser/abouthome/snippet2@2x.png (content/abouthome/snippet2@2x.png) + content/browser/abouthome/downloads@2x.png (content/abouthome/downloads@2x.png) +@@ -45,7 +45,6 @@ browser.jar: + content/browser/abouthome/settings@2x.png (content/abouthome/settings@2x.png) + content/browser/abouthome/restore@2x.png (content/abouthome/restore@2x.png) + content/browser/abouthome/restore-large@2x.png (content/abouthome/restore-large@2x.png) +- content/browser/abouthome/mozilla@2x.png (content/abouthome/mozilla@2x.png) + #ifdef MOZ_SERVICES_HEALTHREPORT + content/browser/abouthealthreport/abouthealth.xhtml (content/abouthealthreport/abouthealth.xhtml) + content/browser/abouthealthreport/abouthealth.js (content/abouthealthreport/abouthealth.js) +diff --git a/browser/locales/en-US/chrome/browser/aboutHome.dtd b/browser/locales/en-US/chrome/browser/aboutHome.dtd +index e84341f..5476d32 100644 +--- a/browser/locales/en-US/chrome/browser/aboutHome.dtd ++++ b/browser/locales/en-US/chrome/browser/aboutHome.dtd +@@ -13,17 +13,6 @@ + + + +- +-latest features."> +- +-Choose from thousands of add-ons."> +- +-Know your rights…"> +- + + + +diff --git a/browser/locales/en-US/chrome/browser-region/region.properties b/browser/locales/en-US/chrome/browser-region/region.properties +index 087cc50..5654eb9 100644 +--- a/browser/locales/en-US/chrome/browser-region/region.properties ++++ b/browser/locales/en-US/chrome/browser-region/region.properties +@@ -3,17 +3,12 @@ + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + + # Default search engine +-browser.search.defaultenginename=Google ++browser.search.defaultenginename=DuckDuckGo HTML + + # Search engine order (order displayed in the search bar dropdown)s +-browser.search.order.1=Google +-browser.search.order.2=Yahoo +-browser.search.order.3=Bing +- +-# This is the default set of web based feed handlers shown in the reader +-# selection UI +-browser.contentHandlers.types.0.title=My Yahoo! +-browser.contentHandlers.types.0.uri=http://add.my.yahoo.com/rss?url=%s ++browser.search.order.1=DuckDuckGo HTML ++browser.search.order.2=DuckDuckGo Lite ++browser.search.order.3=Seeks Search + + # increment this number when anything gets changed in the list below. This will + # cause Firefox to re-read these prefs and inject any new handlers into the +@@ -22,20 +17,10 @@ browser.contentHandlers.types.0.uri=http://add.my.yahoo.com/rss?url=%s + # don't make any spelling errors here. + gecko.handlerService.defaultHandlersVersion=4 + +-# The default set of protocol handlers for webcal: +-gecko.handlerService.schemes.webcal.0.name=30 Boxes +-gecko.handlerService.schemes.webcal.0.uriTemplate=https://30boxes.com/external/widget?refer=ff&url=%s +- +-# The default set of protocol handlers for mailto: +-gecko.handlerService.schemes.mailto.0.name=Yahoo! Mail +-gecko.handlerService.schemes.mailto.0.uriTemplate=https://compose.mail.yahoo.com/?To=%s +-gecko.handlerService.schemes.mailto.1.name=Gmail +-gecko.handlerService.schemes.mailto.1.uriTemplate=https://mail.google.com/mail/?extsrc=mailto&url=%s +- + # The default set of protocol handlers for irc: +-gecko.handlerService.schemes.irc.0.name=Mibbit +-gecko.handlerService.schemes.irc.0.uriTemplate=https://www.mibbit.com/?url=%s ++gecko.handlerService.schemes.irc.0.name=Freenode Web IRC ++gecko.handlerService.schemes.irc.0.uriTemplate=https://webchat.freenode.net + + # The default set of protocol handlers for ircs: +-gecko.handlerService.schemes.ircs.0.name=Mibbit +-gecko.handlerService.schemes.ircs.0.uriTemplate=https://www.mibbit.com/?url=%s ++gecko.handlerService.schemes.ircs.0.name=Freenode Web IRC ++gecko.handlerService.schemes.ircs.0.uriTemplate=https://webchat.freenode.net +diff --git a/browser/locales/generic/profile/bookmarks.html.in b/browser/locales/generic/profile/bookmarks.html.in +index e925c1e..5101035 100644 +--- a/browser/locales/generic/profile/bookmarks.html.in ++++ b/browser/locales/generic/profile/bookmarks.html.in +@@ -15,13 +15,20 @@ +

@bookmarks_toolbarfolder@

+
@bookmarks_toolbarfolder_description@ +

+-

@getting_started@ ++
Parabola GNU/Linux-libre +

+-

@firefox_heading@

++

Parabola GNU/Linux-libre

+

+-

@firefox_help@ +-
@firefox_customize@ +-
@firefox_community@ +-
@firefox_about@ ++
Parabola GNU/Linux-libre ++
Parabola GNU/Linux-libre Packages ++
Parabola GNU/Linux-libre Wiki ++
Parabola GNU/Linux-libre Labs ++

++

Free Software Foundation

++

++

Free Software Foundation ++
LibrePlanet ++
Free addons ++
h-node +

+

+diff --git a/browser/modules/AboutHome.jsm b/browser/modules/AboutHome.jsm +index 98c443d..0173762 100644 +--- a/browser/modules/AboutHome.jsm ++++ b/browser/modules/AboutHome.jsm +@@ -8,7 +8,7 @@ let Cc = Components.classes; + let Ci = Components.interfaces; + let Cu = Components.utils; + +-this.EXPORTED_SYMBOLS = [ "AboutHomeUtils", "AboutHome" ]; ++this.EXPORTED_SYMBOLS = [ "AboutHome" ]; + + Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); + Components.utils.import("resource://gre/modules/Services.jsm"); +@@ -16,66 +16,6 @@ Components.utils.import("resource://gre/modules/Services.jsm"); + XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", + "resource://gre/modules/PrivateBrowsingUtils.jsm"); + +-// Url to fetch snippets, in the urlFormatter service format. +-const SNIPPETS_URL_PREF = "browser.aboutHomeSnippets.updateUrl"; +- +-// Should be bumped up if the snippets content format changes. +-const STARTPAGE_VERSION = 4; +- +-this.AboutHomeUtils = { +- get snippetsVersion() STARTPAGE_VERSION, +- +- /* +- * showKnowYourRights - Determines if the user should be shown the +- * about:rights notification. The notification should *not* be shown if +- * we've already shown the current version, or if the override pref says to +- * never show it. The notification *should* be shown if it's never been seen +- * before, if a newer version is available, or if the override pref says to +- * always show it. +- */ +- get showKnowYourRights() { +- // Look for an unconditional override pref. If set, do what it says. +- // (true --> never show, false --> always show) +- try { +- return !Services.prefs.getBoolPref("browser.rights.override"); +- } catch (e) { } +- // Ditto, for the legacy EULA pref. +- try { +- return !Services.prefs.getBoolPref("browser.EULA.override"); +- } catch (e) { } +- +-#ifndef MOZILLA_OFFICIAL +- // Non-official builds shouldn't show the notification. +- return false; +-#endif +- +- // Look to see if the user has seen the current version or not. +- var currentVersion = Services.prefs.getIntPref("browser.rights.version"); +- try { +- return !Services.prefs.getBoolPref("browser.rights." + currentVersion + ".shown"); +- } catch (e) { } +- +- // Legacy: If the user accepted a EULA, we won't annoy them with the +- // equivalent about:rights page until the version changes. +- try { +- return !Services.prefs.getBoolPref("browser.EULA." + currentVersion + ".accepted"); +- } catch (e) { } +- +- // We haven't shown the notification before, so do so now. +- return true; +- } +-}; +- +-/** +- * Returns the URL to fetch snippets from, in the urlFormatter service format. +- */ +-XPCOMUtils.defineLazyGetter(AboutHomeUtils, "snippetsURL", function() { +- let updateURL = Services.prefs +- .getCharPref(SNIPPETS_URL_PREF) +- .replace("%STARTPAGE_VERSION%", STARTPAGE_VERSION); +- return Services.urlFormatter.formatURL(updateURL); +-}); +- + /** + * This code provides services to the about:home page. Whenever + * about:home needs to do something chrome-privileged, it sends a +@@ -185,17 +125,8 @@ let AboutHome = { + ss.promiseInitialized.then(function() { + let data = { + showRestoreLastSession: ss.canRestoreLastSession, +- snippetsURL: AboutHomeUtils.snippetsURL, +- showKnowYourRights: AboutHomeUtils.showKnowYourRights, +- snippetsVersion: AboutHomeUtils.snippetsVersion + }; + +- if (AboutHomeUtils.showKnowYourRights) { +- // Set pref to indicate we've shown the notification. +- let currentVersion = Services.prefs.getIntPref("browser.rights.version"); +- Services.prefs.setBoolPref("browser.rights." + currentVersion + ".shown", true); +- } +- + if (target) { + target.messageManager.sendAsyncMessage("AboutHome:Update", data); + } else { -- cgit v1.2.3