Ich denke, ich weiß jetzt, warum es nicht immer klappt.
Es scheint so, als ob einige der password Felder, nachdem ich sie zu text Feldern gewandelt habe, "hinten" nochmal auftauchen und zurückgesetzt werden. Ich hatte zuerst den Attribut-Kram in Verdacht und habe deswegen das zuerst umgestellt.
Nachdem das auch nicht geklappt hatte, kam mir langsam der Verdacht und jetzt sieht mein Bookmarklet so aus:
javascript:var inp=document.getElementsByTagName('input');
var pwd=0;
for (var i in inp) {
if (inp[i].type == "password") {
inp[i].type= "text";
inp[i].title= inp[i].title + "\u0000"+inp[i].style.backgroundColor+"\u0000"+inp[i].style.color;
inp[i].style.backgroundColor= "red";
inp[i].style.color= "yellow";
++pwd;
}
}
if (pwd==0) for (var i in inp) {
if (inp[i].type == "text" && inp[i].title.indexOf("\u0000") >= 0) {
var info = inp[i].title.split("\u0000");
console.log(inp[i].title.indexOf("\u0000"));
inp[i].style.backgroundColor= info[info.length-2];
inp[i].style.color= info[info.length-1];
inp[i].title = inp[i].title.substr(0,
inp[i].title.length
-info[info.length-2].length
-info[info.length-1].length
-"\u0000\u0000".length);
inp[i].type = "password";
}
}
void(0);