From 7494a278ae7ec40f82979e182bf7c1c72c22b4df Mon Sep 17 00:00:00 2001 From: JustOff Date: Sat, 14 Apr 2018 00:32:14 +0300 Subject: Use document's principal for favicons in browser --- application/palemoon/components/feeds/FeedWriter.js | 4 +++- application/palemoon/components/sessionstore/SessionStore.jsm | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'application/palemoon/components') diff --git a/application/palemoon/components/feeds/FeedWriter.js b/application/palemoon/components/feeds/FeedWriter.js index 2afa35a5b..28cf582c2 100644 --- a/application/palemoon/components/feeds/FeedWriter.js +++ b/application/palemoon/components/feeds/FeedWriter.js @@ -1395,6 +1395,8 @@ FeedWriter.prototype = { .QueryInterface(Ci.nsIDocShell) .QueryInterface(Ci.nsILoadContext) .usePrivateBrowsing; + var nullPrincipal = Cc["@mozilla.org/nullprincipal;1"] + .createInstance(Ci.nsIPrincipal); this._faviconService.setAndFetchFaviconForPage(readerURI, faviconURI, false, usePrivateBrowsing ? this._faviconService.FAVICON_LOAD_PRIVATE : this._faviconService.FAVICON_LOAD_NON_PRIVATE, @@ -1409,7 +1411,7 @@ FeedWriter.prototype = { self._contentSandbox.menuItem = null; self._contentSandbox.dataURL = null; } - }); + }, nullPrincipal); }, classID: FEEDWRITER_CID, diff --git a/application/palemoon/components/sessionstore/SessionStore.jsm b/application/palemoon/components/sessionstore/SessionStore.jsm index 136a3d8de..5e09ff5c8 100644 --- a/application/palemoon/components/sessionstore/SessionStore.jsm +++ b/application/palemoon/components/sessionstore/SessionStore.jsm @@ -3131,7 +3131,11 @@ let SessionStoreInternal = { // Restore the tab icon. if ("image" in tabData) { - aWindow.gBrowser.setIcon(tab, tabData.image); + // Using null as the loadingPrincipal because serializing + // the principal would be overkill. Within SetIcon we + // default to the systemPrincipal if aLoadingPrincipal is + // null which will allow the favicon to load. + aWindow.gBrowser.setIcon(tab, tabData.image, null); } if (tabData.storage && browser.docShell instanceof Ci.nsIDocShell) -- cgit v1.2.3