Archived Comments (locked)
|
|
The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008) |
|
|
You need to add them in lowercase. Sorry I'll fix that bug (and I'll fix the other bug with the removing function)
|
|
|
Not sure this is working. Thought I'd try it on the main page here, added "Travian" and "Ikariam" to its filter... no changes. |
|
|
Use something like this:
function delNode(targetNode) {
if (targetNode) return targetNode.parentNode.removeChild(targetNode);
return null;
}
HTMLElement in a Greasemonkey script is wrapped in an XPCNativeWrapper, so it won't let you add methods to its prototype. The "Element" in your code isn't a special object, it's a normal variable (an empty anonymous function after the assignment) |
|
|
Thank you so much for this!!! |
|
|
Although I can't use it on previousSibling...
|
|
|
thats strange... it should work in firefox 3.0.3 Try:
HTMLElement.prototype.delete=function() {
this.parentNode.removeChild(this)
};
|
|
|
Error: Element.prototype is undefined Line: 28 but I fixed it with if (!Element.prototype) {
Element = function() {};
}
|
|
|
Not really going to read through it too much, but this might help (and in future scripts too):
Element.prototype.delete=function() {
this.parentNode.removeChild(this)
};
So that once you have an element, e.g. X.parentNode.parentNode.delete() to get rid of it. |