Skip to content

Instantly share code, notes, and snippets.

@scazzy
Forked from Gustavo-Kuze/force-ctrl-c-v.md
Created July 15, 2023 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scazzy/e983e58027d335026e104c6cee81bed8 to your computer and use it in GitHub Desktop.
Save scazzy/e983e58027d335026e104c6cee81bed8 to your computer and use it in GitHub Desktop.
Enable copy and paste in a webpage from the browser console
javascript:(function(){
  allowCopyAndPaste = function(e){
  e.stopImmediatePropagation();
  return true;
  };
  document.addEventListener('copy', allowCopyAndPaste, true);
  document.addEventListener('paste', allowCopyAndPaste, true);
  document.addEventListener('onpaste', allowCopyAndPaste, true);
})(); 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment