jsakamoto / Toolbelt.Blazor.HeadElement

Head element support (change the document title, "meta" elements such as OGP, and "link" elements) for Blazor apps.
https://demo-blazor-headelement.azurewebsites.net/
Mozilla Public License 2.0
158 stars 11 forks source link

Consider falling back on setAttribute when HTMLMetaElement.prototype.media doesn't exist #33

Open wisniewskit opened 1 year ago

wisniewskit commented 1 year ago

Hello from the web compatiblity team at Mozilla, and thank you for your hard work! While diagnosing this webcompat.com report, I noticed that in issue #30, code was added to check meta elements' media property, which Firefox does not yet support.

I was wondering if you would be willing to adjust the code to use getAttribute to fetch the media value when HTMLMetaElement.prototype.media is not yet supported? Otherwise as meta-tags are rewritten, they will end up losing their media attribute, and theme engines relying on it will not function as well (as reported in the webcompat issue).

jsakamoto commented 1 year ago

@wisniewskit Thank you for letting me know!

This is my fault for the lack of E2E testing on Firefox.

I published the fixed version of this library.

They are still "preview" releases because I would like to do more testing on Firefox, but all usual test cases on the .NET 6.0 platform have been passed. I'll appreciate it if you try them out.

Again, thank you for your report!

wisniewskit commented 1 year ago

Thank you so much! Funny enough, because we ran across this, Firefox should support the media property as of version 106 as well, but this will help the ESR versions of Firefox, and might also help other older browser versions.

I don't have a dev environment set up right now to test the package, but I've pinged @thepra here and on the webcompat.com issue, just in case they are the devs of Collanon and want to test it out.

If there's anything we can do to help make E2E testing easier (that we aren't already doing), please don't hesitate to join our chat app or ping one of us on GitHub/Bugzilla to start a discussion!