Polyfill that adds getTotalLength(), getPointAtLength(x), and more to SVGPathElement interface. This addresses missing APIs on browsers like IE11 or older.
Any chance this could get distributed via polyfill.io (or something like it)? Linking to the script with a script tag is pretty convenient but the currently recommended “web browser” method fails for me in Safari 11 & 10. The browser refuses to load the script because Github does not set a mime type on raw files such as https://raw.githubusercontent.com/ThePedestrian/svg-path-polyfill/master/build/svg-path-polyfill.js and the browser will not run a script without a mime type for security reasons. The browser’s console shows a “X-Content-Type: nosniff” error instead:
Arguably, Github should set mime types on these files but not sure if they want people hot linking to them in the first place? It would probably look a little more trustworthy coming from a service as a side benefit.
Looks like a great polyfill though, thanks for writing it! Will likely host a local copy for now but wanted to offer the feedback. Thanks again!