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:
@@ -676,7 +676,8 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal,
|
||||
aPrincipal->OriginAttributesRef().mPrivateBrowsingId > 0);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
// Check the principal is allowed to load the target.
|
||||
return aPrincipal->CheckMayLoad(targetBaseURI, true, false);
|
||||
// Unfortunately we don't have a window id to work with here...
|
||||
return aPrincipal->CheckMayLoadWithReporting(targetBaseURI, false, 0);
|
||||
}
|
||||
|
||||
//-- get the source scheme
|
||||
|
||||
Reference in New Issue
Block a user