DEV Community ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

maphim
maphim

Posted on

Bypass suggest saved password of browser.

<input oninput="onInput(this)" type="text" value=""/>


var passwordReal = [];

function onInput(e) {
   var value = Array.from(e.value);

   // Allow copy
   if (value.indexOf('โ—') < 0) {
      this.passwordReal = value;
   }
   // If current array value is greater than temp array, get the last value just entered
   // Otherwise, calculate to make 2 arrays equal
  else if (value.length > this.passwordReal.length) {
      passwordReal.push(value.pop());
   } else {
      passwordReal.splice(value.length, (passwordReal.length - value.length));
   }

   e.value = passwordReal.map(c => c.replace(/./gi, 'โ—')).join('');

   console.log(passwordReal.join(''));
}

Demo : https://jsfiddle.net/vwp8q720/9/

Top comments (0)

Make Your Github Profile Stand Out

>> Check out this classic DEV post <<