Use both shadowRoot and openOrClosedShadowRoot (#534)

This commit is contained in:
toasted-nutbread 2020-05-10 14:10:02 -04:00 committed by GitHub
parent f85508a25e
commit dd6c3015c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -105,7 +105,10 @@ class FrameOffsetForwarder {
return element; return element;
} }
const shadowRoot = element.shadowRoot; const shadowRoot = (
element.shadowRoot ||
element.openOrClosedShadowRoot // Available to Firefox 63+ for WebExtensions
);
if (shadowRoot) { if (shadowRoot) {
for (const child of shadowRoot.children) { for (const child of shadowRoot.children) {
if (child.nodeType === ELEMENT_NODE) { if (child.nodeType === ELEMENT_NODE) {

View File

@ -530,7 +530,11 @@ class Popup {
_getFrameParentElement() { _getFrameParentElement() {
const defaultParent = document.body; const defaultParent = document.body;
const fullscreenElement = DOM.getFullscreenElement(); const fullscreenElement = DOM.getFullscreenElement();
if (fullscreenElement === null || fullscreenElement.shadowRoot) { if (
fullscreenElement === null ||
fullscreenElement.shadowRoot ||
fullscreenElement.openOrClosedShadowRoot // Available to Firefox 63+ for WebExtensions
) {
return defaultParent; return defaultParent;
} }