linux-scroll-speed-fix icon indicating copy to clipboard operation
linux-scroll-speed-fix copied to clipboard

Extension throws many errors when document is a SVG

Open freshgum-bubbles opened this issue 3 years ago • 1 comments

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

freshgum-bubbles avatar Nov 09 '21 19:11 freshgum-bubbles

Please do! :+1:

Dedas avatar Nov 11 '21 18:11 Dedas