mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-18 07:45:30 +00:00
Bug 1447422 - Better check on aDocument in nsContentUtils::WarnScriptWasIgnored, r=smaug
This commit is contained in:
parent
26df3a2563
commit
e650094aad
@ -5816,17 +5816,20 @@ void
|
||||
nsContentUtils::WarnScriptWasIgnored(nsIDocument* aDocument)
|
||||
{
|
||||
nsAutoString msg;
|
||||
bool privateBrowsing = false;
|
||||
|
||||
if (aDocument) {
|
||||
nsCOMPtr<nsIURI> uri = aDocument->GetDocumentURI();
|
||||
if (uri) {
|
||||
msg.Append(NS_ConvertUTF8toUTF16(uri->GetSpecOrDefault()));
|
||||
msg.AppendLiteral(" : ");
|
||||
}
|
||||
privateBrowsing =
|
||||
!!aDocument->NodePrincipal()->OriginAttributesRef().mPrivateBrowsingId;
|
||||
}
|
||||
msg.AppendLiteral("Unable to run script because scripts are blocked internally.");
|
||||
|
||||
LogSimpleConsoleError(msg, "DOM",
|
||||
!!aDocument->NodePrincipal()->OriginAttributesRef().mPrivateBrowsingId);
|
||||
msg.AppendLiteral("Unable to run script because scripts are blocked internally.");
|
||||
LogSimpleConsoleError(msg, "DOM", privateBrowsing);
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
Loading…
Reference in New Issue
Block a user