Jump to content

How do i block the right-click option on my site?

Recommended Posts

  • Replies 3
  • Views 545
  • Created
  • Last Reply
Posted

Hi,

Insert this code in your Footer Code Injection.

<script>
document.addEventListener('contextmenu', event => event.preventDefault());
</script>

Please use the like button if it helps you!

Best,
Leopold

Ninja Kit Extension: Upgrade your Squarespace website without coding.

YouTube Preview    -    FREE DOWNLOAD

Posted

Thanks Leopold - I am now getting this in the header of my portfolio page. 

 

script type="text/javascript"> $(document).ready(function () { //Disable full page $("body").on("contextmenu",function(e){ return false; }); //Disable part of page $("#id").on("contextmenu",function(e){ return false; }); });

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.