vimium icon indicating copy to clipboard operation
vimium copied to clipboard

Unexpected behavior of Vimium with closed custom elements

Open mono0x opened this issue 2 years ago • 3 comments

Describe the bug

In normal textarea and textarea in open custom elements (attachShadow({ mode: "open" })), shortcuts defined in Vimium are disabled and I can input these keys. However, in textarea in closed custom elements (attachShadow({ mode: "closed" })), shortcuts are handled by Vimium and I cannot input these keys.

Expected:

I can input keys defined as shortcuts to textarea in closed custom elements.

To Reproduce

Here is a reproduction code. https://github.com/mono0x/vimium-closed-custom-element-example

Browser and Vimium version

  • Microsoft Edge 104.0.1293.54 and Vimium 1.67
  • Google Chrome 104.0.5112.102 and Vimium 1.67

mono0x avatar Aug 20 '22 04:08 mono0x

I have the same problem

songpengyuan avatar Oct 07 '23 06:10 songpengyuan

Well it's indeed an issue since ShadowDom V1 has landed.

We may detect it using:

const getShadowRoot = (element) => {
  if (Utils.isFirefox()) {
    return element.openOrClosedShadowRoot
  }
  const isHTMLElement = "lang" in element
  return isHTMLElement ? chrome.dom.openOrClosedShadowRoot(element) : null
}

gdh1995 avatar Oct 15 '23 17:10 gdh1995

Is there a fix in progress?

chestnutchen avatar Apr 18 '24 13:04 chestnutchen