mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 1505494 - not allow autoplay if we don't have a document. r=cpearce
In order to avoid the nullptr crash when using `approver`. Differential Revision: https://phabricator.services.mozilla.com/D11501 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
d40d607632
commit
5657ac5a73
@ -91,6 +91,10 @@ IsWindowAllowedToPlay(nsPIDOMWindowInner* aWindow)
|
||||
}
|
||||
|
||||
nsIDocument* approver = ApproverDocOf(*aWindow->GetExtantDoc());
|
||||
if (!approver) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (nsContentUtils::IsExactSitePermAllow(approver->NodePrincipal(),
|
||||
"autoplay-media")) {
|
||||
AUTOPLAY_LOG("Allow autoplay as document has autoplay permission.");
|
||||
|
Loading…
Reference in New Issue
Block a user