gblazex / smoothscroll

An extension for Google Chrome (150,000+ users)
https://chrome.google.com/webstore/detail/smoothscroll/nbokbjkabcmbfdlbddjidfmibcpneigj
Other
475 stars 98 forks source link

Prevent hijacking keyboard input on web components. #193

Open brettflorio opened 4 years ago

brettflorio commented 4 years ago

Resolves https://github.com/gblazex/smoothscroll/issues/192

To test, try the URLs on #192.

I don't see any adverse behavior with this change. SmoothScroll continues to work normally in all other situations.

gblazex commented 4 years ago

I'm not well versed in Web Components.

Is testing '-' in the nodename a 100% detection?

brettflorio commented 4 years ago

@gblazex I believe it should be just about 100%, as custom elements require a dash in the name, and the spec says:

They contain a hyphen, used for namespacing and to ensure forward compatibility (since no elements will be added to HTML, SVG, or MathML with hyphen-containing local names in the future).

Some additional references:

Fwiw, I submitted a similar fix for another extension that had the same issue. The fix for that extension has worked beautifully, fwiw. I can't promise this won't cause any problems, but I haven't seen any in the past 2 months of using this approach with the other extension, so it seems very solid.

brettflorio commented 4 years ago

@gblazex Any update on this one? Not the biggest of priorities, but we believe it's an easy fix that should fix SmoothScroll with web components. Fwiw, this same treatment on Chrome Type Ahead has worked wonderfully with no side effects.