How To: Reveal Hidden Passwords in Firefox

Today I wanted to replace my router and realized that I don’t remember my ISP’s username and password. Like in any router’s web interface, the ISP’s password is saved behind asterisks (or dots in case of Windows Vista/7) but there’s an easy way to reveal this password in Firefox:

Just paste the following code in your browsers address bar when you’re on the page that displays the username and password of your connection and press Enter.

javascript: var p=r(); function r(){var g=0;var x=false;var x=z(document.forms);g=g+1;var w=window.frames;for(var k=0;k<w.length;k++) {var x = ((x) || (z(w[k].document.forms)));g=g+1;}if (!x) alert('Password not found in ' + g + ' forms');}function z(f){var b=false;for(var i=0;i<f.length;i++) {var e=f[i].elements;for(var j=0;j<e.length;j++) {if (h(e[j])) {b=true}}}return b;}function h(ej){var s='';if (ej.type=='password'){s=ej.value;if (s!=''){prompt('Password found ', s)}else{alert('Password is blank')}return true;}}

And there you go 😉