XHTML pages cause problems for some Firefox addons

July 30, 2021

These days, XHTML is pretty much a dead issue on the web. But browsers still support it and some people do serve real XHTML web pages (for example). What I've noticed on the occasions that I visit these web pages is that their being XHTML can cause problems for some of my Firefox addons. The most common addon that I notice problems with is FoxyGestures, partly because I believe it has to inject things in order to draw gesture trails and partly because I use it all the time.

(With FoxyGestures, the typical symptoms are that it will draw the gesture trails but no other UI elements, and then when I complete a gesture nothing happens. The web developer console reports XHTML errors.)

On the one hand, this is understandable. It's quite easy to create markup that's valid (or accepted) HTML but not valid XHTML, and Firefox does still insist on your XHTML being valid as far as I know. For content modification addons to work on XHTML pages as well as HTML pages, they need to first be aware of the issue (and care about it) and then either craft markup that works on both or detect XHTML pages and use different markup. There are probably plenty of Firefox addons that quietly don't work on XHTML pages.

(This is part of why I haven't reported this as an issue to the FoxyGestures developer.)

On the other hand, that this issue exists is another suggestion that real XHTML pages are quite uncommon on the web today. If XHTML pages were common, people using addons would be running into them frequently enough for things like this to get reported and then probably fixed. Or alternately, the XHTML issue would be well enough known among addon developers that they'd program around it as a matter of course. Sometimes where bugs exist and persist is a sign of where the dark corners are.

(I've never been a fan of XHTML, but it's been a dead issue for some years, cf.)

PS: Another issue for an addon interacting with a real XHTML web page is that apparently the XHTML DOM isn't the same as the HTML DOM, so some DOM manipulation may fail or produce unexpected results (which may then lead the addon to making alterations that aren't valid XHTML).

Written on 30 July 2021.
« How Go maps store their values (and keys)
Hardware and (Linux) driver quality can be invisible to non-specialists »

Page tools: View Source, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Fri Jul 30 00:52:53 2021
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.