mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-18 04:44:17 +00:00
Bug 1466926 - part1 : always allow extension background script to autoplay. r=cpearce
In present web extension design (both Firefox and Chrome), background script can autoplay. We don't want to break this design, so we would always allow it to autoplay. MozReview-Commit-ID: 9BfWgll7PNx --HG-- extra : rebase_source : 7996daa06c31a84a2aea9008daa9bddfcde98c74
This commit is contained in:
parent
e3d83161a1
commit
81ae6fd494
@ -12638,6 +12638,12 @@ nsIDocument::HasBeenUserGestureActivated()
|
||||
return mUserGestureActivated;
|
||||
}
|
||||
|
||||
bool
|
||||
nsIDocument::IsExtensionPage() const
|
||||
{
|
||||
return BasePrincipal::Cast(NodePrincipal())->AddonPolicy();
|
||||
}
|
||||
|
||||
nsIDocument*
|
||||
nsIDocument::GetSameTypeParentDocument()
|
||||
{
|
||||
|
@ -3439,6 +3439,10 @@ public:
|
||||
// document in the document tree.
|
||||
bool HasBeenUserGestureActivated();
|
||||
|
||||
// This document is a WebExtension page, it might be a background page, a
|
||||
// popup, a visible tab, a visible iframe ...e.t.c.
|
||||
bool IsExtensionPage() const;
|
||||
|
||||
bool HasScriptsBlockedBySandbox();
|
||||
|
||||
bool InlineScriptAllowedByCSP();
|
||||
|
@ -71,6 +71,11 @@ IsWindowAllowedToPlay(nsPIDOMWindowInner* aWindow)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (approver->IsExtensionPage()) {
|
||||
// Always allow extension page to autoplay.
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user