|
|
||
IRC: irc://irc.opera.com/japanese <--Opera 日本語ユーザのためのIRCチャンネル。
上のがつながらない場合は irc://irc.se.opera.com/japanese
フォームで下キーを押すとメモ,登録しておいたメールアドレス*1などを挿入できるという機能を無効化しようというもの。
input要素に autocomplete="off" を挿入すればいいっていうことがdel.icio.usのソースを読んでてわかったので,
// ==UserScript==
// @include *
// ==/UserScript==
(function (){
var inp = document.getElementsByTagName('input');
for(var i=0,len=inp.length;i<len;i++) {
if((!inp[i].hasAttribute('autocomplete')) && (inp[i].getAttribute('type') == 'text'))
inp[i].setAttribute('autocomplete','off');
}
})();
includeとexcludeを管理できる仕組みを作れないかなぁ。Greasemonkeyみたいな感じで。
getAttributeでその属性がない場合は"null"が返ってきて問題なくうごくんだけど,hasAttributeのほうが好ましいようなのでhasAttributeに変更した。