Protect Images From Theft Using The ProtectImage.js Library

Views Total:0 views
Official Page:Go to website
Last Update:May 17, 2021


Protect Images From Theft Using The ProtectImage.js Library


ProtectImage.js is a tiny (less than 1kb) JavaScript library that protects images on your site from theft by disabling right-click and hiding the image source in the console log.

How to use it:

1. Import the script.min.js JavaScript library into the document.

<script src=""></script>

2. Add the protected attribute to images.

<img src="" protected />

3. Initialize the library and done.

window.onload = function() {

4. The library will show the image on an HTML5 canvas element instead and hide the real image path in the console log:

<canvas width="620" height="465"></canvas>
<img src="" protected="">

Source link

Add comment


All visitors can share my site’s content on their blogs, sites, and social networks to enrich the content

Only share the source

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.