From 05e44d895f595307d5fbcd0b2b5256cfdccb5ea3 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Mon, 30 Apr 2018 23:08:16 +0200 Subject: Bug 1341589 - Set triggeringPrincipal on history entry for view-source loads --- toolkit/components/viewsource/content/viewSource-content.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toolkit') diff --git a/toolkit/components/viewsource/content/viewSource-content.js b/toolkit/components/viewsource/content/viewSource-content.js index fa1dd19f1a..70d23eaa46 100644 --- a/toolkit/components/viewsource/content/viewSource-content.js +++ b/toolkit/components/viewsource/content/viewSource-content.js @@ -330,6 +330,8 @@ var ViewSourceContent = { .createInstance(Ci.nsISHEntry); shEntry.setURI(BrowserUtils.makeURI(viewSrcURL, null, null)); shEntry.setTitle(viewSrcURL); + let systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal(); + shEntry.triggeringPrincipal = systemPrincipal; shEntry.loadType = Ci.nsIDocShellLoadInfo.loadHistory; shEntry.cacheKey = shEntrySource.cacheKey; docShell.QueryInterface(Ci.nsIWebNavigation) -- cgit v1.2.3