Skip to content

Instantly share code, notes, and snippets.

@JohnDDuncanIII
Last active May 10, 2021 19:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JohnDDuncanIII/5d5d51331c05e6bb9fdbad77fa1f1b28 to your computer and use it in GitHub Desktop.
Save JohnDDuncanIII/5d5d51331c05e6bb9fdbad77fa1f1b28 to your computer and use it in GitHub Desktop.
document.createElementHTML = element => document.createElementNS("http://www.w3.org/1999/xhtml", element)
document.createElementXUL = element => document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", element)
htmlNS = () => document.createElement = document.createElementHTML
// https://bugzilla.mozilla.org/show_bug.cgi?id=1479050
// https://bugzilla.mozilla.org/show_bug.cgi?id=1479538
// https://bugzilla.mozilla.org/show_bug.cgi?id=1631439
// https://developer.thunderbird.net/add-ons/updating/tb78/changes#changed-xul-elements
xulNS = () => document.createElement = (
// Mozilla 63+
document.createXULElement ||
// Mozilla 1-62
document.createElementXUL
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment