From 28359952370ecdd107ff6ffa2c4a8dbc718c5adc Mon Sep 17 00:00:00 2001 From: girst Date: Sat, 3 Jun 2023 15:36:23 +0200 Subject: [PATCH] fix utils.isInShadowRoot At some point before firefox 84, the global `ShadowRoot` object stopped being === to the ShadowRoot returned by utils.getDocument. this caused following links to not work because the special code paths for elements within shadow roots was not taken any longer. The check whether ShadowRoot is defined can be safely dropped, since even though ChromeWindow doesn't export ShadowRoot itself, accessing it through element.ownerGlobal still works. --- extension/lib/utils.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension/lib/utils.coffee b/extension/lib/utils.coffee index 05e0f45..51390d9 100644 --- a/extension/lib/utils.coffee +++ b/extension/lib/utils.coffee @@ -27,7 +27,7 @@ XULMenuListElement = Ci.nsIDOMXULMenuListElement getDocument = (e) -> if e.parentNode? then arguments.callee(e.parentNode) else e isInShadowRoot = (element) -> - ShadowRoot? and getDocument(element) instanceof ShadowRoot + getDocument(element) instanceof element.ownerGlobal.ShadowRoot isXULElement = (element) -> XUL_NS = 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul' -- 2.39.3