skeeve: Bookmarklet funktioniert manchmal nicht

Beitrag lesen

Moin!

Ich habe ein bookmarklet, daß mir alle <input type="password"...> in type text wandeln soll. Zusätzlich speichere ich in einem Attribut des Elements die alten style Daten um sie beim zweiten Aufruf des Bookmarklets zurück zu setzen.

Hier erstmal das Script:

javascript:var inp=document.getElementsByTagName('input');  
for (var i in inp) {  
	try {  
		if (inp[i].type == "password") {  
			inp[i].setAttribute("was_password", inp[i].style.backgroundColor + ":" + inp[i].style.color);  
			inp[i].type= "text";  
			inp[i].style.backgroundColor= "red";  
			inp[i].style.color= "yellow";  
		}  
		else if (inp[i].getAttribute("was_password") != null) {  
			inp[i].type="password";  
			var old= inp[i].getAttribute("was_password").split(":");  
			inp[i].style.backgroundColor= old[0];  
			inp[i].style.color= old[1];  
			inp[i].removeAttribute("was_password");  
		}  
	}  
	catch (e) {}  
}  
void(0);

Meistens funktionierts, aber auf einigen Seiten nicht und ich verstehe einfach nicht, warum.

Zum Beispiel funktioniert es auf http://www.perlmonks.org nicht aber auf z.B. GMX' Login Seite oder auf http://forum.de.selfhtml.org/usermanagement/register.php?for=forum

Habt Ihr irgendwelche hilfreiche Tipps für mich?

Ich verwende momentan FF26 auf WinDOS7