Guest Posted October 31, 2012 Posted October 31, 2012 I was wondering if you could please help me as I would greatly appreciate it. I am really in a jam... Could you please tell me the code able to BLOCK RIGHT CLICK so people can not see/view resources.... I can't thank you enough in advance... Best to you, Gianluca
Guest Posted October 31, 2012 Posted October 31, 2012 Can't promise this is going to work but in your code injection add <SCRIPT language=JavaScript> var message = "function disabled"; function rtclickcheck(keyp){ if (navigator.appName == "Netscape" && keyp.which == 3){ alert(message); return false; } if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) { alert(message); return false; } } document.onmousedown = rtclickcheck; </SCRIPT> Note: This will just stop them right clicking. If they want to there are other ways for people to view source code. I'm also unsure if SS6 has Java or Jquery installed.
dcde Posted December 13, 2012 Posted December 13, 2012 Hey, so I tried it and it seems that it doesn't work for safari. First it says "function disabled", but after clicking OK, it still opens the rich klick menue... :(
tom Posted December 19, 2012 Posted December 19, 2012 It worked for me - thank you very much for this!
rgrphoto Posted February 15, 2013 Posted February 15, 2013 This worked better for me: <script language=JavaScript> var message="Function Disabled!"; function clickIE4(){ if (event.button==2){ alert(message); return false; } } function clickNS4(e){ if (document.layers||document.getElementById&&!document.all){ if (e.which==2||e.which==3){ alert(message); return false; } } } if (document.layers){ document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS4; } else if (document.all&&!document.getElementById){ document.onmousedown=clickIE4; } document.oncontextmenu=new Function("alert(message);return false") </script>
rgrphoto Posted February 15, 2013 Posted February 15, 2013 Inject this header code. This worked better for me: <script language=JavaScript> var message="Function Disabled!"; function clickIE4(){ if (event.button==2){ alert(message); return false; } } function clickNS4(e){ if (document.layers||document.getElementById&&!document.all){ if (e.which==2||e.which==3){ alert(message); return false; } } } if (document.layers){ document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS4; } else if (document.all&&!document.getElementById){ document.onmousedown=clickIE4; } document.oncontextmenu=new Function("alert(message);return false") </script>
rgrphoto Posted February 25, 2013 Posted February 25, 2013 I agree, that would be ideal for me too. Unfortunately I don't know how to disable to message. Here's where I found the code. Hope it helps. http://www.hypergurl.com/norightclick.html
Geli Posted February 25, 2013 Posted February 25, 2013 I got this from Squarespace, inject this as header code: <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> Squarespace Code Library - Disable Right CLick Thanks and best regards.
vndc Posted July 23, 2013 Posted July 23, 2013 Where can I add this code to disable the right click in the template I'm using (ishimoto)?
rgrphoto Posted July 25, 2013 Posted July 25, 2013 Not sure about your specific template and if it's back end is different than mine for some reason but go to the settings (gear) tab > code injection > paste the code into the header and save.
mudhouse Posted August 11, 2013 Posted August 11, 2013 That's great, but it doesn't prevent someone from dragging an image to the desktop. Even in a small browser window, the dragged file is the full 1500 pixel wide version that was uploaded. Is there any way to prevent this?
kale Posted August 11, 2013 Posted August 11, 2013 Highly unlikely - and even if there is, there will be another simple workaround. Trying to stop people from getting your images from your website is virtually impossible if they're determined.
mudhouse Posted August 11, 2013 Posted August 11, 2013 I'd like to be able to provide a good viewing experience to site visitors, with large images, but I don't want to make it *too" easy for them to download. A 1500 pixel wide image is marginally printable, and it can certainly be used for unauthorized web display, even if it's cropped or resized. I was hoping that I could avoid dropping the size down to something that wouldn't be of much use to unauthorized "borrowers". If dragging an image from a page would always result in a file that was the smallest of Squarespace's six sizes, then I'd probably be OK with uploading 1000-1200 pixel originals. I suggested this in a Customer Care ticket, and I'm waiting for a response....
aporter Posted August 11, 2013 Posted August 11, 2013 I could screenshot your images, regardless of the code you have added to your page or steps that Squarespace takes on your end - this goes both for dragging as well as right clicking. Watermarking is a decent deterrent. Not associated with Squarespace.
jschroth Posted October 22, 2013 Posted October 22, 2013 When I type any of these in it says syntax error?
Guest Posted June 2, 2014 Posted June 2, 2014 Hey everyone I've figured out how to fix this. Mind you I don't know how it is if it is in a gallery. I have my images added by the "add a image" block as I prefer this look over the galleries. When you add the image in the same block that comes up where you upload the image if you scroll down there is a "click through link" area. Here you can add an external link etc. which will be a result to when then right click or I think click period on your photo. I have mine set to my blog. So anytime anyone right clicks or clicks my photos it directs them to my blog automatically. If they right click and save what actually gets saved is an html file that when opened leads right to my blog. I hope this helps!! Love and light to everyone and good luck with their websites!! Michelle
Guest Posted August 18, 2014 Posted August 18, 2014 Add this one to prevent people from saving using mobile devices. Header:
abhijit Posted December 22, 2014 Posted December 22, 2014 Please check the link [how to disable right click in any website][1] [1]: http://abhijitpal.in/disable-right-click-website/ . You can get your solution.
jorge1570047971 Posted March 29, 2015 Posted March 29, 2015 Question, Does anybody know how to disable the "right click setting " for a "gallery page" type. the template i am using is FORTE. I tried to use other codifications but for some reason they are not working. please any help will be very appreciated!! thank you,Jorge.
Guest Posted September 22, 2015 Posted September 22, 2015 I used the code. It does disable the right click, but the image can be dragged to the desktop or a new tab and it opens in the high resolution :(How do I prevent that?
Guest Posted September 22, 2015 Posted September 22, 2015 I used the code. It does disable the right click, but the image can be dragged to the desktop or a new tab and it opens in the high resolution :( How do I prevent that?
Guest Posted May 25, 2016 Posted May 25, 2016 I use this code to disable the Save option on iOS (iPhone and iPad): body { -webkit-user-select:none !important; -webkit-touch-callout:none !important; -moz-user-select:none !important; -ms-user-select: none !important; user-select: none !important; touch-callout: none !important; } It can be added to the Design -> Custom CSS panel of your site. It doesn't work on Chrome, but it's a start.
Cindy1570048209 Posted July 24, 2016 Posted July 24, 2016 <script language=JavaScript> var message="Function Disabled!"; function clickIE4(){ if (event.button==2){ alert(message); return false; } } function clickNS4(e){ if (document.layers||document.getElementById&&!document.all){ if (e.which==2||e.which==3){ alert(message); return false; } } } if (document.layers){ document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS4; } else if (document.all&&!document.getElementById){ document.onmousedown=clickIE4; } document.oncontextmenu=new Function("alert(message);return false") </script> This worked on Chrome for me today. Thank you all so much !!!!!
Guest aspilette Posted January 9, 2017 Posted January 9, 2017 This worked for us! Thank you, Cindy.We tried each of the scripts on the page. This is the only one that worked.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.