linux-scroll-speed-fix
linux-scroll-speed-fix copied to clipboard
Extension throws many errors when document is a SVG
When the document is a SVG element[0], this extension's code throws the following error(s):
content.js:198 Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
at computedOverflow (content.js:198)
at overflowNotHidden (content.js:202)
at overflowingAncestor (content.js:177)
at XMLDocument.wheel (content.js:120)
This error is thrown on each scroll wheel move.
I would suggest a check for document.documentElement instanceof SVGElement
and, if true, do nothing. Would you like a PR?
[0]: Just to be clear, what I mean by 'SVG element' is something like this.
freshgum
Please do! :+1: