x
Highlighted

Disabling RightClick Downloading of Images in Online Store

I'm a photographer selling online prints of my photos, and I'm considering using the online store to host my site. Is there a way to disable right-clicking of images to prevent digital downloads? I'm not a huge fan of watermarks, because I think they detract from the image (which is contrary to the whole point), so I'm hoping there's a way to prevent (or at least make it harder!) for people to right click and save the image I'm selling without me using those.

 

I hope that makes sense! Thanks for your help!

Message 1 of 3
114 Views
1 Best Answer

Accepted Solutions
Highlighted

Re: Disabling RightClick Downloading of Images in Online Store

Best Answer

I figured out the answer to my own question, but I'll put it here for anyone else who is looking to do this.

 

In the Online Store Dashboard page, go to Website -> Integrations -> Add Custom Header Code -> Add New Code

 

Add this code:

 

<!-- Following code will prevent right click on images place is just above closing </body> tag -->
<script>

document.oncontextmenu = function(e){
var target = (typeof e !="undefined")? e.target: event.srcElement
if (target.tagName == "IMG" || (target.tagName == 'A' && target.firstChild.tagName == 'IMG'))
return false

}

</script>
<!-- code to prevent right click ends here -->

 

And click on "End of Body" where it asks where the code should be placed. 

 

(Note, I didn't write this code, only grabbed it from another Weebly forum, here: https://community.weebly.com/t5/Vote-on-Features/Disable-Right-Click-On-Photos/idi-p/7662# )

 

Hope that helps someone else looking to protect their images. 😀

View Best Answer >

Message 2 of 3
83 Views
2 REPLIES 2
Highlighted

Re: Disabling RightClick Downloading of Images in Online Store

Best Answer

I figured out the answer to my own question, but I'll put it here for anyone else who is looking to do this.

 

In the Online Store Dashboard page, go to Website -> Integrations -> Add Custom Header Code -> Add New Code

 

Add this code:

 

<!-- Following code will prevent right click on images place is just above closing </body> tag -->
<script>

document.oncontextmenu = function(e){
var target = (typeof e !="undefined")? e.target: event.srcElement
if (target.tagName == "IMG" || (target.tagName == 'A' && target.firstChild.tagName == 'IMG'))
return false

}

</script>
<!-- code to prevent right click ends here -->

 

And click on "End of Body" where it asks where the code should be placed. 

 

(Note, I didn't write this code, only grabbed it from another Weebly forum, here: https://community.weebly.com/t5/Vote-on-Features/Disable-Right-Click-On-Photos/idi-p/7662# )

 

Hope that helps someone else looking to protect their images. 😀

View Best Answer >

Message 2 of 3
84 Views
Highlighted
Admin

Re: Disabling RightClick Downloading of Images in Online Store

Looks like you beat us to the punch here, @EBPhotography 😊

 

Thank you for posting the solution you discovered here for others to see! I'm sure this will be incredibly helpful for other photographers and artists hoping to mitigate art theft while maintaining the integrity of their art. Thanks again, and please don't hesitate to reach out directly if needed!

Message 3 of 3
67 Views