Using prototype.js in chrome
February 9th, 2007
12 comments
Are you writing a Firefox/Thunderbird extension, or maybe a XULRunner app, and want to make use of the Prototype JS library? Then you will run into this issue.
Because of a long-standing bug in Mozilla, Function.prototype cannot be extended with the method ‘bind’, and so all the utilities in Prototype.js that make use of bind() won’t work as expected. Once again, this happens with documents loaded from _chrome_, not with normal web pages.
Steve Conover posted a workaround for this bug, about a year ago. I’m happy to offer a patch against Prototype 1.5.0 (final), with that workaround applied. Hope you’ll find it useful.
Categories: programming