how to block right-click on my site
Hi, anyone can help ?
i want to Block right-Click when some one visit My Website and also don't allow to save the Web Page ,
is it possible to do it with Simple HTML code ?
any help appreciated ,
Hi, anyone can help ?
i want to Block right-Click when some one visit My Website and also don't allow to save the Web Page ,
is it possible to do it with Simple HTML code ?
any help appreciated ,
DarkLight posted this at 13:41 — 11th May 2009.
He has: 287 posts
Joined: Oct 2007
Simply replace
<body>
with<body oncontextmenu="return false;">
It is not possible to prevent someone from saving the webpage, as once they visit the page it has already been downloaded into their Temp folder for your browser to display to you.
Hope this helps
All the best news here: https://newsbotnet.com
Megan posted this at 13:46 — 11th May 2009.
She has: 11,421 posts
Joined: Jun 1999
Here is another thread on this topic:
http://www.webmaster-forums.net/html-css-and-javascript/how-block-right-...
Just keep in mind that you're probably going to annoy a lot of people who use right-click to access other browser functions.
I've never heard of any way to block users from file > save as. Why are you so worried about people saving the page?
Megan
Connect with us on Facebook!
Greg K posted this at 13:49 — 11th May 2009.
He has: 2,145 posts
Joined: Nov 2003
IMO, the people you "Stop" with disabling the right click are not going to have skills to do anything with your site you need to worry about.
Also, for people like me who like to right click to click on BACK for the browser, it will annoy (I really hate not having a back button on the mouse for my laptop!)
-Greg
DarkLight posted this at 13:58 — 11th May 2009.
He has: 287 posts
Joined: Oct 2007
That's right. If the guy has the skills to actually "use" your coding, then he will also have the skills to "null" the no-right-click function. E.g.
javascript:void oncontextmenu(null)
In addition, I never use right-click for getting the source code, I simply hit CTRL+U, which opens the code up directly. I don't know if that works for anything other than Firefox, though.
All the best news here: https://newsbotnet.com
Greg K posted this at 14:23 — 11th May 2009.
He has: 2,145 posts
Joined: Nov 2003
There is also the option to do File -> Save Page as in most browsers's menu bar.
greg posted this at 15:31 — 11th May 2009.
He has: 1,581 posts
Joined: Nov 2005
Are all methods that even kids know how to do. It really is a bad idea as you remove functionality to genuine users, 99.999% of visitors.
And as Greg pointed out, it only stops the people who are of no danger.
Anyone of any threat will have learned ways around the right click when they were 5 years old.
Greg K posted this at 15:57 — 11th May 2009.
He has: 2,145 posts
Joined: Nov 2003
When they were 5 years old???
That was 1977! 8 years before I got my first computer.
LOL, couldn't resist.
-Greg
greg posted this at 16:45 — 11th May 2009.
He has: 1,581 posts
Joined: Nov 2005
No grasshopper, hackers are only 12 yo these days, making it 2002
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.