JSFiddle - React, Tailwind, and code Playground
by dfreedm
HTML
<pre id="out"></pre>
CSS
#out {
white-space: pre-wrap;
border: 1px solid black;
}
JavaScript
var cache = {};
function genBlackList(tag) {
var a = [], p = document.createElement(tag), ks, n = p.localName;
while (p) {
if (!(ks = cache[n])) {
ks = Object.getOwnPropertyNames(p);
cache[n] = ks;
}
a = a.concat(ks);
p = Object.getPrototypeOf(p);
n = p && p.constructor;
}
return a;
}
function isBlackListed(tag, prop) {
return genBlackList(tag).indexOf(prop) > -1;
}
out.textContent = isBlackListed('h1', 'textTracks');
out.textContent += '\n' + isBlackListed('video', 'prefix');