This post originated from an RSS feed registered with Web Buzz
by Stuart Langridge.
Original Post: __defineSetter__ in Mozilla
Feed Title: as days pass by
Feed URL: http://feeds.feedburner.com/kryogenix
Feed Description: scratched tallies on the prison wall
If I override a property in Moz with __defineSetter__, can I get at
the original property inside my setter function? Say I wanted to add
something to a page so that every time someone tried to set
anyelement.style.display, it alerted “hello” and then set the value
they specified. I could do
function setterfn(newstyle) {
alert('hello');
this.display = newstyle;
}
CSSStyleDeclaration.prototype.__defineSetter('display',setterfn);
Of course, that [...]