From d735c1c1ad9b0ebaf24a0d468dda0b69bdaae060 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Mon, 30 Apr 2018 23:54:01 +0200 Subject: Bug 1359204 - Use SystemPrincipal as TriggeringPrincipal when loading page as view-source --- docshell/base/nsDocShell.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docshell') diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 8f924567c..b3e26da33 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -5689,6 +5689,11 @@ nsDocShell::LoadPage(nsISupports* aPageDescriptor, uint32_t aDisplayType) } shEntry->SetURI(newUri); shEntry->SetOriginalURI(nullptr); + // shEntry's current triggering principal is whoever loaded that page initially. + // But now we're doing another load of the page, via an API that is only exposed + // to system code. The triggering principal for this load should be the system + // principal. + shEntry->SetTriggeringPrincipal(nsContentUtils::GetSystemPrincipal()); } rv = LoadHistoryEntry(shEntry, LOAD_HISTORY); -- cgit v1.2.3