summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-05-10 14:10:02 -0400
committerGitHub <noreply@github.com>2020-05-10 14:10:02 -0400
commitdd6c3015c4af6db5f1deca797366ed6269b7d82c (patch)
tree20724fc8f300ac7d6e9367639a751bb7c1d602bd
parentf85508a25edb49de96bebb77a5832931f0819eff (diff)
Use both shadowRoot and openOrClosedShadowRoot (#534)
-rw-r--r--ext/fg/js/frame-offset-forwarder.js5
-rw-r--r--ext/fg/js/popup.js6
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;
}