diff options
| -rw-r--r-- | content_scripts/ui_component.coffee | 3 | ||||
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 5 | 
2 files changed, 6 insertions, 2 deletions
| diff --git a/content_scripts/ui_component.coffee b/content_scripts/ui_component.coffee index c71bfb35..d3145eb3 100644 --- a/content_scripts/ui_component.coffee +++ b/content_scripts/ui_component.coffee @@ -27,7 +27,8 @@ class UIComponent          seamless: "seamless"        shadowWrapper = DomUtils.createElement "div"        # PhantomJS doesn't support createShadowRoot, so guard against its non-existance. -      @shadowDOM = shadowWrapper.createShadowRoot?() ? shadowWrapper +      @shadowDOM = shadowWrapper.attachShadow?( mode: "open" ) ? +        shadowWrapper.createShadowRoot?() ? shadowWrapper        @shadowDOM.appendChild styleSheet        @shadowDOM.appendChild @iframeElement        @toggleIframeElementClasses "vimiumUIComponentVisible", "vimiumUIComponentHidden" diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index ff27c8a4..0f5d05f2 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -245,7 +245,10 @@ flashFrame = do ->        # Create a shadow DOM wrapping the frame so the page's styles don't interfere with ours.        highlightedFrameElement = DomUtils.createElement "div"        # PhantomJS doesn't support createShadowRoot, so guard against its non-existance. -      _shadowDOM = highlightedFrameElement.createShadowRoot?() ? highlightedFrameElement +      # https://hacks.mozilla.org/2018/10/firefox-63-tricks-and-treats/ says +      # Firefox 63 has enabled Shadow DOM v1 by default +      _shadowDOM = highlightedFrameElement.attachShadow?( mode: "open" ) ? +        highlightedFrameElement.createShadowRoot?() ? highlightedFrameElement        # Inject stylesheet.        _styleSheet = DomUtils.createElement "style" | 
