From dd6c3015c4af6db5f1deca797366ed6269b7d82c Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 10 May 2020 14:10:02 -0400 Subject: Use both shadowRoot and openOrClosedShadowRoot (#534) --- ext/fg/js/frame-offset-forwarder.js | 5 ++++- ext/fg/js/popup.js | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ext/fg/js/frame-offset-forwarder.js b/ext/fg/js/frame-offset-forwarder.js index 1a2f3e1e..9b68d34e 100644 --- a/ext/fg/js/frame-offset-forwarder.js +++ b/ext/fg/js/frame-offset-forwarder.js @@ -105,7 +105,10 @@ class FrameOffsetForwarder { return element; } - const shadowRoot = element.shadowRoot; + const shadowRoot = ( + element.shadowRoot || + element.openOrClosedShadowRoot // Available to Firefox 63+ for WebExtensions + ); if (shadowRoot) { for (const child of shadowRoot.children) { if (child.nodeType === ELEMENT_NODE) { diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js index d45c7c2a..9e9debd8 100644 --- a/ext/fg/js/popup.js +++ b/ext/fg/js/popup.js @@ -530,7 +530,11 @@ class Popup { _getFrameParentElement() { const defaultParent = document.body; const fullscreenElement = DOM.getFullscreenElement(); - if (fullscreenElement === null || fullscreenElement.shadowRoot) { + if ( + fullscreenElement === null || + fullscreenElement.shadowRoot || + fullscreenElement.openOrClosedShadowRoot // Available to Firefox 63+ for WebExtensions + ) { return defaultParent; } -- cgit v1.2.3