From acf09d2285b47d5849b4315ac698182dad7e9c13 Mon Sep 17 00:00:00 2001 From: gdh1995 Date: Sun, 28 Oct 2018 11:45:14 +0800 Subject: use Shadow DOM v1 if it exists Chrome 70 has deprecated Shadow DOM v0 and displayed a warning when it's used. And accroding to https://www.chromestatus.com/features/4507242028072960, Shadow DOM v0 will be removed since Chrome 73. The support for Shadow DOM v1 has been there since Chrome 53 and is enabled by default on Firefox 63, so it's time to use it. Old support is still needed because Vimium's min_chrome_version is 51. --- content_scripts/ui_component.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'content_scripts/ui_component.coffee') diff --git a/content_scripts/ui_component.coffee b/content_scripts/ui_component.coffee index c71bfb35..f0815d08 100644 --- a/content_scripts/ui_component.coffee +++ b/content_scripts/ui_component.coffee @@ -27,7 +27,7 @@ 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?() ? shadowWrapper.createShadowRoot?() ? shadowWrapper @shadowDOM.appendChild styleSheet @shadowDOM.appendChild @iframeElement @toggleIframeElementClasses "vimiumUIComponentVisible", "vimiumUIComponentHidden" -- cgit v1.2.3