On many webpages they are blocking copy/paste using JavaScript.

Is there any way for making such inputs work as the should (e.g. enable copy/paste)?

I’m using Google Chrome.

  • Its very unlikely. They don't put in that for no reason, so they'll also block any kind of way to circumvent it.
    – LPChip
    May 26, 2015 at 10:49
  • 1
    There are lots of way of circumventing such scripts and a dedicated browser extension should solve many wariants of this issue.
    – syntagma
    May 26, 2015 at 10:54
  • 2
    If you already know this, why do you post the question?
    – LPChip
    May 26, 2015 at 10:56
  • 1
    I know it is doable, I don't know about any such extension.
    – syntagma
    May 26, 2015 at 10:57
  • 2
    If you were using Firefox, you could go to about:config and change dom.event.clipboardevents.enabled to false. I don't know if something similar exists in Chrome.
    – user276648
    Jul 18, 2017 at 3:05

11 Answers 11


Simply highlight the text and drag it into the text field. Try it here!

This works for me in Firefox and Chrome.

  • 4
    Great solution! In chrome you can put this string into the address bar "data:text/html, <html contenteditable>" (without the quotes) to get a blank canvas. I created a bookmark to that. Now I can paste my text into this blank page, then drag it into the fields that need filling.
    – thin
    Oct 4, 2018 at 18:08
  • This is the best. Trying to run js in the developer console was giving me a headache. Many thanks!
    – Millar248
    Feb 9, 2019 at 1:35
  • Cool, man? thank you.. You saved my time. Dec 4, 2019 at 8:12
  • 5
    This doesn't work when the &*@(!$ web developers disable ondrag too. 😞
    – Dan
    May 3, 2020 at 23:38
  • Awesome, in my case it was an application acting as a browser wrapper. I couldn't do a drag & drop of the string from a notepad file, but it worked from a wordpad file!
    – Wadih M.
    Jul 23, 2021 at 20:32

Press F12 and paste the following code into the console.

var allowPaste = function(e){
  return true;
document.addEventListener('paste', allowPaste, true);
  • This didn't work for me with Chrome Version 101.0.4951.64 (Official Build) (64-bit) to try to paste into the password field of Super Auto Pets. Jun 2, 2022 at 22:58

If you're using Firefox, I found the following solution. Not sure what minimum version is required, however.

  1. Go to about:config
  2. Search for dom.event.clipboardevents.enabled
  3. Double-click it to change the value to false

This allowed me to paste immediately after changing it. I didn't even have to restart the browser.


Here's an open source Chrome Extention


If you're interested in the code https://github.com/jswanner/DontFuckWithPaste

  • 1
    This should be the correct answer. Don't Fuck With Paste has 465 stars on Github and practically a 5 star rating on the Chrome Store - with 413 reviews. This really helped me. Thanks!
    – Ben
    Jun 24, 2018 at 13:48
  • For me, this extension helps, but does not work on all sites.
    – thin
    Oct 4, 2018 at 18:10

It's hacky and won't work always but a lot of the time there is just a listener set for CTRL+C / CTRL+V and you can get around it by using CTRL+INS / SHIFT+INS instead of copy / paste.

If they are doing something goofy like using flash to write an empty string to the clipboard in a loop (twitch) then you are out of luck.


The easiest workaround (in terms of user-friendliness) for Google Chrome would be adding Allow Copy extension.

  • 3
    Carefully vet that extension before installing. Reviewers are claiming it's malware.
    – George
    Jan 19, 2017 at 21:48

Decide to add my solution to this (making a bookmarklet inspired from this repo and extension https://github.com/jswanner/DontFuckWithPaste) This bookmarklet will also allow copying on documents that disable that using javascript.

  allowCopyAndPaste = function(e){ 
      return true;
  document.addEventListener('copy', allowCopyAndPaste, true);
  document.addEventListener('paste', allowCopyAndPaste, true);
  document.addEventListener('onpaste', allowCopyAndPaste, true);


  • Please do not post the same answer to multiple questions. If the same information really answers both questions, then one question (usually the newer one) should be closed as a duplicate of the other. You can indicate this by voting to close it as a duplicate or, if you don't have enough reputation for that, raise a flag to indicate that it's a duplicate. Otherwise tailor your answer to this question and don't just paste the same answer in multiple places.
    – DavidPostill
    Oct 30, 2017 at 18:19

You could simply disable JavaScript on the page using a simple bookmarklet. From. http://javascript.about.com/library/bldis.htm

If you create a bookmark that contains the following script as the link (or even paste this code into the address bar and press enter) then it will rip all the JavaScript off of the current page:


The problem of course is that while you will now be able to paste into that text box if the form used JavaScript to submit the form then that too will be broken.


On windows you can use AutoHotkey


Send [....text… Use  {enter} for line breaks]

example: if you type xyz it will write the text below (as if it was written)

Send hi {enter} This a new line  {enter}. Another new line  {enter} whatsoever. {enter} 
  • 1
    I like this one: ^Q:: SendInput, {Raw}%clipboard% CTRL-Q sends the contents of the keyboard as input (similar to typing it in)
    – nijave
    Aug 16, 2018 at 1:25

For Windows, I maintain an open-source app DevComrade which, amongst other things, simulates typing of the current clipboard text upon hitting Win+Ins. Perfect for those pesky websites and desktop apps messing with the paste functionality.


On Microsoft Windows, I use a voice command in Dragon NaturallySpeaking to paste text from the clipboard into input fields that block it copy-pasting:

Sub Main
    SendKeys Clipboard
    Rem originalClipboard = Clipboard
    Rem Clipboard("str(" & originalClipboard & ")")
    Rem SendKeys "originalClipboard"
    Rem Wait(1)
    Rem Clipboard(originalClipboard)
End Sub

enter image description here

I've used that solution for many years with Dragon NaturallySpeaking 12.5 + Windows 7 + mostly Chrome, it works on all websites. The only limitation is if the copied text is very long, in which case one gets the following error message:

enter image description here

I've never bothered improving the script to accept a very long text input, since fields expecting a long input text pretty much always accept copy-pasting, but that should be straightforward if needs be.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .