Skip to content

Instantly share code, notes, and snippets.

@Gustavo-Kuze
Last active June 3, 2024 09:37
Show Gist options
  • Save Gustavo-Kuze/32959786ce55b2c3751629e40c75c935 to your computer and use it in GitHub Desktop.
Save Gustavo-Kuze/32959786ce55b2c3751629e40c75c935 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);
})(); 
@agarzon
Copy link

agarzon commented Jan 31, 2024

Does not work in some bank websites

@yacanka
Copy link

yacanka commented Feb 13, 2024

Thanks.

@emarashliev
Copy link

Awesome! Thank you!

@CristianCazares
Copy link

Thanks.

@Jxnatan7
Copy link

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment