Source code for bookmarklet Remove Fonts.
javascript:
(function(){
function cE(a)
{
var a2 = [];
for (var k = 0; k < a.length; ++k) {
a2.push(a[k]);
}
return a2;
}
var rp = 0;
function ra(n)
{
var as = cE(n.attributes);
for (var k = 0; k < as.length; ++k) {
n.removeAttribute(as[k].name);
++rp;
}
}
function eD(dt)
{
var t = cE( dt.getElementsByTagName("FONT") );
for (var k = 0; k < t.length; ++k) {
ra(t[k]);
}
alert("Attributes removed: " + rp);
}
// "dIr" == "documentIterator"
function dIr(dt, f) {
function ifsr( fs )
{
for (var i = 0; i < fs.length; ++i)
{
try {
dIr(fs[i].contentDocument, fs[i]); // recursive call
}
catch (e) {
alert(e || "Unspecified error");
}
}
}
if (dt == null) {return;}
eD(dt, f);
ifsr( dt.getElementsByTagName("FRAME") );
ifsr( dt.getElementsByTagName("IFRAME") );
}
// iterate through all documents
dIr(document, null);
}());