Last modified 4 years ago
Last modified on 08/29/08 20:56:03
A few selected html transformations:
Simple subsitution of contents:
t = t.replace(/documentation/, "pure void");
A convenience method is provided for this, so the above code can be reduced to:
replace(/documentation/, "pure void");
Some sites don't provide a desciptive <title> but uses the company name for all pages. This can be fixed by extracting a resonable name from the html body and updating the <title> using the convenience function gb.setDocumentTitle():
var m = t.match(/<h1><span id="item_name">(.+?)<\/span><\/h1>/i); if (m) gb.setDocumentTitle(m[1]);
Some sites works best without Javascript at all because they do awful things like using Flash™ where a simple <img> would suffice. A simple convenience function fixes this:
gb.zapScriptElements();
