Skip to content

Instantly share code, notes, and snippets.

@tjimenez
Forked from Gustavo-Kuze/force-ctrl-c-v.md
Created June 5, 2025 15:29
Show Gist options
  • Select an option

  • Save tjimenez/fbcae2de10722edf5793d92236d76a88 to your computer and use it in GitHub Desktop.

Select an option

Save tjimenez/fbcae2de10722edf5793d92236d76a88 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