// ==UserScript== // @name Essai // @namespace sebsauvage.net // @include http://sebsauvage.net/links/* // ==/UserScript== (function () { // Removes all occurences of elements whose XPath is provided from the document. // // Example: Remove all tables which use the CSS class 'toto': // removeElement("//table[@class='toto']"); function removeElement(ElementXpath) { var alltags = document.evaluate(ElementXpath,document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null); for (i=0; i: // removeAttributeOfElement('bgcolor',"//table[@bgcolor]") // Remove the fixed with of all tables or cells:: // removeAttributeOfElement('width',"//table[@width]|//td[@width]") function removeAttributeOfElement(attributeName,ElementXpath) { var alltags = document.evaluate(ElementXpath,document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null); for (i=0; i=6 and position()<=9]"); removeElement("//th[text()='Nombre de discussions']/ancestor::table[1]"); setAttributeOfElement('style','font-weight:bold; background-color:#FFFFE8',"//tr/td[position()=last() and text()='0']/../descendant::*"); setAttributeOfElement('style','font-size:8pt;','//tr[@class=\"fb\"]/td') removeElement("//span[@class='Datered' or @class='Dategris' or @class='Date']/following-sibling::br"); removeElement("//div[@id='colonneDroite']/div/div/h2[text()='Extraits de la charte']/ancestor::div[1]"); } catch (e) { alert("UserScript exception:\n" + e); } })();