How to disable the right click for a Kiosk website
March 5, 2015 / by Marco / Categories : Google, Technology
In the past several post you may have noticed that I’ve been writing quite a bit about Chrome and Kiosk. There is a reason for this as I’ve been involved in setting up a Kiosk for a project. Now in this post I’m just going to write down how I disabled the right click (context menu) for a Kiosk website. I have discovered that disabling the Press and Hold setting in Windows did not actually disable this in Chrome. See below image as to what I’m refeering to:

So what I had to do was to include some code in the website page (as is what is being displayed on the Kiosk).
The code that I used is:
<script>
window.oncontextmenu = function() {
return false;
};
</script>This disables the content menu function on that particular site but note that it’s only for this web page. If someone was to visit another web page the content menu will be displayed.
Here’s an example code that displays a coming soon image on the web page.
<html>
<script>
window.oncontextmenu = function() {
return false;
};
</script>
<body bgcolor="#d2232a">
<img src="coming_soon.png" width="1900" height="1060">
</body>
</html>In the above example, the webpage just displays a coming soon image. The script section disables the context menu. I had to change the body colour to red because the image was in red and didn’t want to show any white around it. The pixel size of the actual image was 1920×1080 however when the image was loaded it displayed the scroll bars so to fix this issue I set the width and height to 1900×1060 which fixed the problem.
OTHER ARTICLES YOU MAY LIKE
SUPABASE BACKUP TUTORIAL: USE DBEAVER TO EXPORT YOUR DATABASE SAFELY
If you are building anything serious on Supabase, whether that is a client portal, a SaaS app, an internal dashboard, or even a small side project that is starting to get traction, having a reliable database backup process is one of those tasks that quickly moves from optional to essential. Supabase makes a lot of […]
read more
USE FUSEBASE TO AUTOMATE TEAMWORK AND COLLABORATION
If your business is growing, your team is juggling too many moving parts, and your client communication is spread across email threads, chat apps, documents, task boards, and endless follow ups, there is a good chance the real problem is not effort but fragmentation. Most businesses do not lose time because people are lazy. They […]
read more




