Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
in Q2A Core by
I want to add this code to prevent full copy from my website
where i can add this code?
or do something like it?
document.addEventListener('copy', (event) => {

  let appendLNK = `\n\nللمزيد: ${document.location.href}`;

  event.clipboardData.setData('text', document.getSelection() + appendLNK );



1 Answer

+1 vote
You do not do that.

Whatever you do to prevent visitor to copy content from the page shown to him it would not work. It may just make it harder to copy, but not to prevent it.
right anyone can copy it from source or if you want to hide from source , it is possible
I don't need to prevent copy completely

I just waon to copy anything but in the last write
For more information visit mysite.com