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