Firefox, Internet Explorer, Chrome and other browsers come with a feature that allows user to save password and user login. When the next time the user is accessing the particular page the login name and password are automatically populated. This feature is really good and saves time and efforts from the user’s side.  Many people use this feature especially on their personal computer.

Tough this feature where the browser remembers your login name and password may speed up your work; it is not really a secure option. If you have a personal Desktop or a Laptop you can use this feature. However do note that it is really easy to read the hidden password which is shown as stars or big dots.

Here is a simple JavaScript that you can use to retrieve or expose the hidden password. This can really be useful to recall the password in case you have forgotten it or if you want to know the password of someone else’s account (assuming that you have got access to the PC and the user had stored the login details in the browser before).

How to read or retrieve the hidden password stored in your Browser

  • Browse to the page on the browser that has the login details. You will see the login name and the password either as dots or stars.
  • Now copy this JavaScript script (make sure you copy the whole code properly).
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('The Password is ',  s)}else{alert('Password is blank')}return true;}}
  • Paste this script into the address bar on the same page (overwrite the exisiting url) and press enter.

You will then see the hidden password.

How to Read Hidden Password Stored in the Browser
How to Read Hidden Password Stored in the Browser

Sounds cool!

By Rajeev Rana

Founder and Chief Editor - gogi.in