-
Right Click protection?
Can anyone help me with the code for protecting users fromright clicking in ie and viewing the source code?, thanks
-
Ultimate Member
Well, you could go to a website that has that feature, right-click and view the source code. Sorry, I just couldn't resist.
Ok, how about downloading CodeLifter from http://www.codelifter.com/ then going to a website that has right-click protection and view their source code with it.
Good luck,
Steve
-
Code:
<SCRIPT LANGUAGE="JavaScript">
<!--
var sorry="Sorry, Please Ask before trying to take my images."
function click(e)
{
if (document.all)
{
if (event.button == 2)
{
alert(sorry);
return false;
}
}
if (document.layers)
{
if (e.which == 3)
{
alert(sorry);
return false;
}
}
}
if (document.layers)
{
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
//-->
</SCRIPT>
-
Banned
nice try,
doesn't protect code, just javascript objects. post url, and I'll post back HTML.
Also, don't work in IE2...
-
Banned
BTW, I have not found a website that could hide client code from me or my browser and my browser's rowdy friends. Simply put, if you send the code to the browser, I can view the code. Therefore the truly only way to protect your precious logic is to use server side processing.
Anyway, that is not what you want to hear, so...
There is a couple of tricks for this:
One is this:
http://insights.iwarp.com/advanced/secureimages.html
The other is to use the fact that javascript can capture right click event on objects. This can be esily used to defeat the right click, Save As on images. Though it will not defeat a motivated individual from getting image from other manners. Anyway, the trick becomes having a transparent object covering the whole page/frame. From there the right click is captured and the popup menu never happens.
But, basically HTTP and HTML are straight text and should be considered almost open source. You can't copyright an HTML table layout, much like you can't copyright the "head" tag.
-
Anime Otaku
I'll agree with qball, as it is always possible to extract the HTML. The only decent protection scheme I've ever seen involved a a complex plugin application that processed encyrpted HTML through a Java or ActiveX interface within the browser. I don't remember the name of the project, perhaps someone else could provide this info.
Robert Richmond
-
Yeah i used codelifter on some protected sites and fount this one:
<SCRIPT language=JavaScript>
function click() {
if (event.button==2) {
alert('TEXT MESSAGE HERE');
}
}
document.onmousedown=click
var win='toolbar=1,directories=0,menubar=0,scrollbars= 1,resizable=1,width=650,height=450';
function go(url)
{
window.open(url,'',win)
}
var ch = 0;
</SCRIPT>
-
There is an easy way, if you just put
<body oncontextmenu="return false">
for the start body tag the right click is disabled (in ie5), however this doesn't stop the user from choosing view|source.
Regards,
Deo
-
as mentioned in previous replys here, it's close to impossible to stop someone from seeing the html (all Flash might work?). heck, you just have to view the page once, go to your cache folder, find it, and open with notepad!
but, if your gonna try, IMO I believe that the oncontextmenu method, as mentioned by deob197, is a better choice than detecting mouse buttons, since most keyboards have a 'right-mouse-button-key'. So if the document has focus you just hit your key, get the context menu and choose 'View Source'.
keep in mind tho that the oncontextmenu event is probably only good for more recent browser versions. So maybe a combination of the two methods would be even better...
ciao!
... another way to view it is to prefix the url with view-source:. Ex:view-source:http://some_url.com then hit enter. So you may also want to open the page with a window.open method and not display the addressbar!!
cya!
[This message has been edited by ^hyd^ (edited 08-24-2001).]
-
Member
even if you add a no right click to the page you can still go up to view and then select source and as long as people can see the page the code will be on there computer somehow and they will be able to see it
-
Senior Member
This is all true. Using server-side processing will protect code. ^Hyd^ is correct - in my experience, you can do as you please in Flash and the "code" will not be exposed without having to obtain the source file. Images cannot be saved unless you do a screenshot and create a jpg from it.
It sucks that this is true, because it makes me sound partial to the tool... nevertheless, this is all true. All you see in the source code of a Flash embedded HTML file is the actual code to embed the Flash movie. Use the "Protect From Import" option and users will only get an error when trying to load up an SWF thru the Flash program.
Obviously, this is not what you need, LeaDxPainT, but the option is there if you're willing to use it.
[This message has been edited by rh71 (edited 08-30-2001).]
-
These things don't protect the code, you can simply press ALT+V S to bring up source and images can still be dragged to the desktop.
..WahreZ
-
Senior Member
What, may I ask, does ALT + V S do? Nothing in my browser... ALT V takes you to the View menu on IE... then nowhere.
-
Member
I think he meant ALT-V, C - at least thats what it is in IE6.
In any case, theres an easy way to get round any right click protection, just go into options and turn off javascript - works every time.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
New Security Features Planned for Firefox 4
Another Laptop Theft Exposes 21K Patients' Data
Oracle Hits to Road to Pitch Data Center Plans
Microsoft Preps Array of Windows Patches
Microsoft Nears IE9 Beta With Final Preview
Simplified Analytics Improve CRM, BI Tools
Android Passes RIM as Top Mobile OS in 2Q
VMware Updates Hyperic System Management
File Monitoring Key to Enterprise Security
LinkedIn Snaps Up SaaS Player mSpoke
|
Bookmarks