Skip to content

Instantly share code, notes, and snippets.

@supernovaplus
Forked from Gustavo-Kuze/force-ctrl-c-v.md
Created May 13, 2023 16:27
Show Gist options
  • Save supernovaplus/466d7de3097562272d448a1cf2270490 to your computer and use it in GitHub Desktop.
Save supernovaplus/466d7de3097562272d448a1cf2270490 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