DEV Community

abbazs
abbazs

Posted on

How to paste into text fields in websites that block pasting?

Press F12 and paste the following code into the console.

var allowPaste = function(e){
  e.stopImmediatePropagation();
  return true;
};
document.addEventListener('paste', allowPaste, true);
Enter fullscreen mode Exit fullscreen mode

Viola one can now paste into any text filed.
Repeat again if the site again blocks pasting.

Top comments (1)

Collapse
 
aravind2707 profile image
Aravind Srinivas

PS : can also open the console by pressing Ctrl + Shift + J (Windows / Linux) or Cmd+Opt+J (Mac) and paste the above code to enable pasting on websites that block it!

hope it helps :)<3