Restrict copying content with CSS and JS
One caveat is that you can't absolutely prevent content copying. However, you can restrict these actions.
This article will show you how to use CSS & JS code to restrict copying content on the website.
Normally, in order to copy a Text or Image, users will use operations such as Select, Drag & Drop and Right Click. Now, we're going to block it.
To prevent behaviors like Drag & Drop, Select, you just need to add the following CSS code:
* {
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
}
To prevent right click, add the following JS:
document.addEventListener("contextmenu", function(e){
e.preventDefault();
}, false);
Note: Older browsers may not support these features. See table below for details:
CSS: user-select
Element API: contextmenu event
For websites that use Joomla source code, you need to install the Custom HTML module to add them.
You can also add advanced settings like apply this restriction only to guests (Access) or to certain pages (Menu Assignment).
I hope this article will be useful to you!
Thanks in advance.
tiktok still not showing. Where else do I have to check? (่joomla4)
I've just installed the component to migrate K2 to articles on a very large site, and I have some problems:
I have 5000+ tags, and only 1400 were moved to Joomla tags.
What is the best practice for migrating the K2 items and saving the same IDs that I was using in the K2 items and categories if I already have articles and categories with the same IDs? Do I need to delete them before and check the box to "use the same K2 ID"?
The custom field type "select" doesn't seem to migrate correctly to Joomla fields. It adds the field but not with the correct type, and it fails to move the corresponding data to it.
Please let me know if you have any suggestions or solutions to these issues.
Thank you,