backdropper icon indicating copy to clipboard operation
backdropper copied to clipboard

import and innerHTML are inappropriate

Open jabcreations opened this issue 2 years ago • 0 comments

Hi,

While looking for a polyfilly for backdrop-filter I came across this project. Two things:

First innerHTML is a proprietary Microsoft method and it does not work properly with the DOM. You should never use innerHTML as in example id attributes are not properly validated and in many browsers that new id won't be seen.

Secondly import has low compatibility which negates the point of creating a polyfill. This polyfill won't work in Pale Moon, Opera or Waterfox thus negating it's use. Just stick with using named functions that can be called via the DOMContentLoaded / onload event:

window.onload = function(event) { polyfill_backdrop(); }

I don't know what an NPM package is, I don't know why everyone convolutes things. It's a script, put it in a named function and call the function. If you care about the project and iron those issues out please let me know. Also if you're having trouble with innerHTML you can look up JAB Creations javascript docs, you'll find plenty of functions such as xml_add and CSS specific functions though I'd be happy to help out here too.

jabcreations avatar Sep 04 '22 00:09 jabcreations