Jump to content

Looking for someone who can write simple code for Squarespace

Recommended Posts

  • Replies 1
  • Views 174
  • Created
  • Last Reply

Hello,

You can use the following code to block the right click function. There are still some workarounds for users that are motivated enough to steal your images and content but this will prevent a user from downloading and/or viewing the source materials for your website.

To insert the code, navigate to the Code Injection menu -- Home > Settings > Advanced > Code Injection.

Squarespace can be picky about where the code is inserted for it to work. First try inserting the code into the Header Code Injection field -- Hit "Save" and open your website in a new window and test. If that doesn't work, move the code to the the Footer Code Injection field.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
 $(function () {
   $(this).bind("contextmenu", function (e) {
     e.preventDefault();
   });
 });
</script>

 

In terms of blocking specific users from accessing your website, you may want to research a third-party IP address plugin like "IP-Approval".

 

Hope this helps!

Link to comment

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.