http://www.perlmonks.org?node_id=703793


in reply to Re^3: Most printer friendly version of the documentation?
in thread Most printer friendly version of the documentation?

...by means of a css setting...
...If I could block your top-level posts in Newest Nodes, I would

While current CSS selectors don't yet provide an optimal way of creating such selections, you could inject some JavaScript for that purpose. Here's an example that should do the trick in current Gecko browsers:

function xselect(xpath, root) { var doc = root ? root.ownerDocument : document; var res = []; var qry = doc.evaluate(xpath, root || document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0, len = qry.snapshotLength; i < len; i++) res.push( qry.snapshotItem(i) ); return res; } var pageID = xselect( './/table[@id="titlebar-bottom"]//span[@class="addlinks"]/a[1]/text( +)' )[0]; var pageContent = xselect('.//td[@class="main_content"][1]')[0]; if (pageID == "3628") { // Newest Nodes // ignore posts from these users [ 'Anonymous Monk', 'foo', 'bar' ].forEach(function(monkName) { xselect( './/td[2][starts-with(@class,"node-from-")]/a[text()="' + monkName + '"]/ancestor::tr[1]', pageContent ).forEach(function(row) { row.parentNode.removeChild(row); }); }); }