Bug 1602090 part 2. Create separate CheckMayLoad and CheckMayLoadWithReporting APIs. r=ckerschb
CheckMayLoadAndReport takes a window ID. This allows us to report errors from it to the web console as needed. Most consumers know statically whether they want reporting or not, so there's no reason to force the ones that don't to provide window ids. Differential Revision: https://phabricator.services.mozilla.com/D56388
This commit is contained in:
@@ -10886,8 +10886,8 @@ nsDocShell::AddState(JS::Handle<JS::Value> aData, const nsAString& aTitle,
|
||||
// It's a file:// URI
|
||||
nsCOMPtr<nsIPrincipal> principal = document->GetPrincipal();
|
||||
|
||||
if (!principal ||
|
||||
NS_FAILED(principal->CheckMayLoad(newURI, true, false))) {
|
||||
if (!principal || NS_FAILED(principal->CheckMayLoadWithReporting(
|
||||
newURI, false, document->InnerWindowID()))) {
|
||||
return NS_ERROR_DOM_SECURITY_ERR;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user