具体的には
以下のようにとれる
| ブラウザ | 方法 |
|---|---|
| Opera | HTMLElement.prototype |
| Firefox | HTMLElement.prototype OR document.documentElement.__proto__.__proto__ |
| Konqueror (たぶんSafariも(情報求む)) | document.documentElement.__proto__ |
prototype を書き換えるとそれと繋がるオブジェクトは全て書き換わる
これはおもしろい。
たとえば。。。
Ptototype.js の Event.observe もワンライナーで書けるよ!
//Executable
(HTMLElement.prototype||document.documentElement.__proto__||{}).attachEvent=function(name,func){this.addEventListener(name.replace(/^on/,''),func,false)};