HTML help

This is the one I know, but it's in Javascript:

Code:
<script language="JavaScript1.2"> 
if (window.Event) 
document.captureEvents(Event.MOUSEUP); 
function nocontextmenu()  
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
function norightclick(e)	
{
if (window.Event)	
{
if (e.which == 2 || e.which == 3)
return false;
}
else
if (event.button == 2 || event.button == 3)
{
event.cancelBubble = true
event.returnValue = false;
return false;
}	
}
document.oncontextmenu = nocontextmenu;		
document.onmousedown = norightclick;		
</script>

Hope it helps! :)
 
Turning off right clicking for the main window will annoy most people, especially when they go to save, say, a screenshot or a graph or something rom your site, or when they want quick access to "Add to favorites..." and things like that. It's not worth it imo, especially when "View -> Source" is also on the toolbar...
 
they can steal your code by viewing source from the toolbar, as rathched so markedly pointed out. even if you prevent that somehow, as long as the page is on their system, they can access the code. Only way to keep people from seing code is to have the server compile it (say PHP or some other script) and output HTML, this way the ingenious code you actually made isn't seen by the user.
 
RAGE LT MAN said:
they can steal your code by viewing source from the toolbar, as rathched so markedly pointed out. even if you prevent that somehow, as long as the page is on their system, they can access the code. Only way to keep people from seing code is to have the server compile it (say PHP or some other script) and output HTML, this way the ingenious code you actually made isn't seen by the user.
They can still get access to your raw HTML though. I don't see the big deal anyway, HTML is so easy any monkey can do it. Even the "advanced" stuff is not worth trying to protect. Some Javascript code might be worth the effort, but there are ways to go about that that don't involve disabling browser features.
 
The other thing I want to do is to hide links from the site so that people don't steal them, but the URL can show up at the bottom of the browser...anyone know how to shield it?
 
SuperSonic2K3 said:
The other thing I want to do is to hide links from the site so that people don't steal them, but the URL can show up at the bottom of the browser...anyone know how to shield it?
You can set the window.status to something for the links onmouseover event, that would hide the link showing up in the status bar. That certainly wouldn't stop people from copying the shortcut to their clipboard though.
Code:
<a href="somesecretlink.htm" onmouseover="window.status='some text';return true;" onmouseout="window.status='';return true;">link</a>

Sounds to me like someone is making a porn or warez site... :)
 
RAGE LT MAN said:
links can always be stolen, they just open the page, see the URL in the address bar, and they're set.
Yep, the best way to prevent someone from leeching from you is to use an anti-leech script.
 
Perhaps everyone should hide their code and not share with anyone, so you can invent the wheel over and over and over again.

If you have something the world should not know about you can hide your code or put it into an .asp/.php server side script, or create your own component.

Everything that is html/javascript is, and should be, free for everyone to use/learn from, so that they at a latter stage can create something new that others will learn/steal from.

Allow people to download the entire site code as a link, and just ask them to credit you if they decide to use things from it, some people will do this, others will steal it anyway.

Disabling the 'client' is a bad way to go around creating a web page, and there are several ways to "disable" this anti-client behaviour, as others here have already written some of.

Taking control/restricting the users client/browser is unacceptable.
 
Internet Code Protection.

Internet Code Protection.

Don't forget that most browsers cache pages.
Making it easy to view the page from there.

A lot of work needs to be done to protect
internet code. Have most of the work done on
the server side, and only present HTML code
on the client side.

Always expect the clients to have the ability
to see the source of the page that is sent
to the browser.

Take it from a person who works for an ASP
(Application Service Provider) its not impossible,
just not that easy.
;)
 
Additionally if anyone wants to disable highlighting text on the page (not recommended, but for copy protection), here's the code:

Code:
<script language="JavaScript1.2">

function disableselect(e){
return false
}

function reEnable(){
return true
}

//if IE4+
document.onselectstart=new Function ("return false")

//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</script>
 
i have an idea why don't u just disable all functions in the browers apart from clicking links, scrolling and exiting the page :P that would fix it altho why would someone wanna steal HTML code. My mum can write HTML so why does it matter
 
Y-STU-K said:
i have an idea why don't u just disable all functions in the browers apart from clicking links, scrolling and exiting the page :P that would fix it altho why would someone wanna steal HTML code. My mum can write HTML so why does it matter

If it's an important Javascript proggie, such as my prized text fader, then there goes 5 hours of hard work ripped. Currently I use a Javascript encoder to help eliminate the original coded JS.
 
This is starting to sound like our IT departments idea on security.

There are so many damn scanners, passwords and security applets running that the pc hangs.

Security is 100%.....productivity occurs in the remaining 0%

Hiding code is the devils work! :lol: Sorry forgot ol smiley
 
Back
Top