Bug 1145470 - remove hiddenWindow specialcasing from CheckLoadURI code, r?bholley draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 30 Mar 2017 11:16:17 +0100
changeset 553573 d431c511a56696ee09136b8455241db03758dcd8
parent 553519 43dc24dfbffa788a0920b9db7221f950b5c0052a
child 622123 1d11b4c885bfbf67fe38810785b970f6ee13be29
push id51700
push userbmo:gijskruitbosch+bugs@gmail.com
push dateThu, 30 Mar 2017 10:27:35 +0000
reviewersbholley
bugs1145470
milestone55.0a1
Bug 1145470 - remove hiddenWindow specialcasing from CheckLoadURI code, r?bholley All the consumers relying on this have disappeared, so we can (finally!) get rid of this ugly bit of special-casing. MozReview-Commit-ID: HSeeG21O0p4
caps/nsScriptSecurityManager.cpp
--- a/caps/nsScriptSecurityManager.cpp
+++ b/caps/nsScriptSecurityManager.cpp
@@ -893,24 +893,16 @@ nsScriptSecurityManager::CheckLoadURIFla
                 bool accessAllowed = false;
                 reg->AllowContentToAccess(aTargetBaseURI, &accessAllowed);
                 if (accessAllowed) {
                     return NS_OK;
                 }
             }
         }
 
-        // Special-case the hidden window: it's allowed to load
-        // URI_IS_UI_RESOURCE no matter what.  Bug 1145470 tracks removing this.
-        nsAutoCString sourceSpec;
-        if (NS_SUCCEEDED(aSourceBaseURI->GetSpec(sourceSpec)) &&
-            sourceSpec.EqualsLiteral("resource://gre-resources/hiddenWindow.html")) {
-            return NS_OK;
-        }
-
         if (reportErrors) {
             ReportError(nullptr, errorTag, aSourceURI, aTargetURI);
         }
         return NS_ERROR_DOM_BAD_URI;
     }
 
     // Check for target URI pointing to a file
     rv = NS_URIChainHasFlags(aTargetURI,