How to remove unnecessary type attribute for JavaScript via API

(and the matomo contact form seems out of order, so here goes…)

Hey matomo

I was chatting with André Bräkling, the developer of the Matomo-integration plugin for WordPress, regarding a simple HTML validation warning I’d love to get rid of. André writes that the unnecessary type attribute origins from the matomo api, and while he will probably be able to filter it out, it would be even better if it was removed from the script altogether.

Not sure I make sense - please see the thread at https://wordpress.org/support/topic/how-to-remove-unnecessary-type-attribute-for-javascript/

André suggest I reach out to you, thus this email.

Thank you for a great product. I recommend it to all that cares about privacy and open source.

Kind regards
Bjarne

Hi,

I talked about a bit here:

The main point is: This is unnecessary and redundant in HTML5 and therefore for far over 99% of all users. But the thing is: For a tiny fraction of users (e.g. those using IE8 and older) this is needed as otherwise the browser doesn’t know which language the <script> is.

If you don’t care about those ancient browsers, you can definitly remove the type=, but removing it for everyone in Matomo is a bit harder.
I guess it should be done the day matomo.js doesn’t support those browsers anymore.

Internet Explorer 8 was released twelve years ago, and had end of life six years ago. Purely an opinion - but is it wise to keep pampering users of an obsolete browser no longer supported by its creator, at the cost of a (slightly, admittedly) less optimal experience for the 99% rest? I don’t think so.

Also, if using IE8, not supporting HTML5 or CSS3 properly, you have way more severe UX problems than missing out on getting your visit recorded by matomo.

Maybe IE browser support could be optional in matomo, just like do-not-track and IP anonymization?

As a site owner, using “modern” web techniques like CSS grid and custom properties, my sites support a vide range of modern browsers on many devices - but not IE - so it’s not that flipping that switch in matomo, serving recommended html, would not be the dealbreaker anyway. I’ve already “lost” my IE visitors.