Bug 1318911. When creating an about:blank content viewer during a history navigation to a javascript: URI, use the right principal. r=tanvi
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 06 Dec 2016 07:41:42 -1000
changeset 325313 c2c07c7606bcdd7eec12c79c4d78949b5919c247
parent 325303 deacac546efaedc8b7a5eef776bf9bba8398d401
child 325314 0d7431e24546049ee2bd0fb1e05a5b124ed01f81
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewerstanvi
bugs1318911
milestone53.0a1
Bug 1318911. When creating an about:blank content viewer during a history navigation to a javascript: URI, use the right principal. r=tanvi
docshell/base/nsDocShell.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -12438,17 +12438,17 @@ nsDocShell::LoadHistoryEntry(nsISHEntry*
   if (NS_FAILED(rv) || isJS) {
     // We're loading a URL that will execute script from inside asyncOpen.
     // Replace the current document with about:blank now to prevent
     // anything from the current document from leaking into any JavaScript
     // code in the URL.
     // Don't cache the presentation if we're going to just reload the
     // current entry. Caching would lead to trying to save the different
     // content viewers in the same nsISHEntry object.
-    rv = CreateAboutBlankContentViewer(triggeringPrincipal, nullptr,
+    rv = CreateAboutBlankContentViewer(principalToInherit, nullptr,
                                        aEntry != mOSHE);
 
     if (NS_FAILED(rv)) {
       // The creation of the intermittent about:blank content
       // viewer failed for some reason (potentially because the
       // user prevented it). Interrupt the history load.
       return NS_OK;
     }