Right Click Disable for Static WebPage

Hello Team

I am new here and new/Blank to code as well, . I am basically a web hoster and platform guy on Cloud, where i help my client to migrate their application to cloud,. So my field and expertise is on Infrastructure and platform level, not the applications and code, That is the brief intro of me,.

So, my Requirement is I want someone to help me on how to disable right click on a static page (HTML page), in step by step with the code and where and how to append in the page. All i know is it is with some script that does.

I would be very grateful if anyone could guide me through this.

Thanks in advance.
Sam :slight_smile:

1 Like

Welcome to the forums, @lalsamuelhaokip.

My first question would have to be “Why do you want to do this?” Visitors expect their browsers to behave in certain ways, and removing part of the functionality can cause frustration.

If we understand the issue, we might be able to suggest a better solution.

1 Like

Hi TechnoBear

Thanks for the response.

The reason i want to disable is because I want to create a portfolio of myself so I do not want anyone to download my photo or any content in the page, that is the reason.

So can you help me??

Thanks again.

1 Like

It’s not something I’ve ever used - or would ever use - so I can’t help you there. It’s possible to disable right-click using JavaScript, but if the visitor has JS disabled, that will have no effect. However, I’m sure somebody will be able to give you the code, if you think it’s worth trying.

However, the only sure way to prevent copying of content is to not put it on-line in the first place. Your page has to be downloaded to a visitors computer in order for them to see it. You can make it more difficult for them to save images, but not impossible. Watermarking images might be another option.

1 Like

Hmm,. Thanks again at-least for the suggestions.
I have come across some site who does that, you can have a look at this website they too have disabled the right click.(http://getintopc.com/)
The similar way I too want for my site.
Anyway, I take my chances someone maybe out there who can help me with my requirement.

Thanks Bro,. :slight_smile:

1 Like

Yes; that site is using JS to doisable right-click. If you temporarily disable JS in your browser, you’ll see that right-click works just fine.

I’ve seen a site where the first time a visitor right-clicks, they are shown a pop-up asking them to respect the copyright of the site, but after that, the right-click functionality returns to normal. However, they no longer seem to be bothering with it, so I can’t show you it in action.

1 Like

Okey,. I got it, As you said if the script is disable in the browser it will not take effect, that is okey,. But I just want to use the same in my site.

1 Like

Don’t put your photo or any content online then. :wonky:

coothead

2 Likes

Lol,. That is a nice one,. But I have to put some pic so,. that is the reason I ask for help to disable right click,.

2 Likes

If you view the source of the page you linked to, you can see the javascript that they are using to prevent you from copying their code and content.
In fact you can then copy the code that prevents you copying their stuff and use it yourself. :upside_down:

Do you see the point I’m making?

2 Likes

Oh Yea,. I think you miss my intro,. I am not a coder bro,. I don’t understand if I even see it and what is what,. you will know my status and my need if you read my comment properly. need someone who can help me with the step by step procedure as well.

Thanks anyway.

1 Like

Tapping and holding an image using an iPad Mini allows saving files.

1 Like

Hi there SuperiorSam,

even the dumbest, non savvy internet user has these
basic options…

  1. Use the keyboard “Prt Sc” button.
  2. Click ‘File’, click ‘Print’.

…to get your stuff. :winky:

Smart savvy internet users will just think that
you are a retro twentieth century coder. :rofl:

coothead

1 Like

I think maybe you’ve missed @SamA74’s point.

Anybody can view the page source for the page you linked to, and see the code that’s used to “prevent” copying. Then they can copy that very code and use it themselves. In other words, the script can’t prevent copying of anything, not even itself.

Yes, you can use that script (or similar), but the people most likely to try copying from your site for nefarious purposes will be undeterred by it, while genuine visitors are likely to be frustrated by the disabling of the right-click function.

1 Like

It is a mute point anyways for I don’t even have to do right click on my iMac. I would just do command-shift-4 if I wanted to copy a picture badly enough. :wink:

1 Like

People forget that anyone with a modern browser can download anything they want. For instance, one doesn’t need a “download” button nor have the ability to right click on the page. People who fall for this trick aren’t usually tech savvy. So one of the ways that can bypass this “disabling right click” is just simply using modern browsers. In Firefox, you go to the Tools menu in the top bar. I don’t recall which sub menu comes after that, but there’s something like Page Info. And all you just have to do is click on the Media tab and there’s all the images straight from the current page. You don’t need a “download” button in order to download anything.

@Pepster64 another way would be opening up the Terminal in both Linux and Mac and typing in

wget http://......

Like @coothead said. If you don’t want people downloading your images, don’t put it up on the Internet. I guess one way to make a copyright infringement on it is to write or make some kind of watermark that is very noticeable and if someone removes it, it would ruin the image. That’s most likely your best bet right now.

2 Likes

even the dumbest, non savvy internet user has these
basic options…

Use the keyboard “Prt Sc” button.
Click ‘File’, click ‘Print’.

I know that as well,. I just want to disable right click in code level,. that is all my requirement,. I too know all that are possible,.

1 Like

Hi Spaceshiptrooper,.

I am well aware of all the possible to get the content as well,. I just want to know how to do it in script level,. that is all my requirement,.

1 Like

As I said, it’s not something I would ever use, but a quick search reveals there are a number of tutorials available if you want to do this. For example, there are three different methods here:

Pick one to try and post back if you need more help.

2 Likes

The requirement here is mainly to use the script and get hands on it,. I know all the way around to get the content,.

1 Like