FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


do you know is it possoible to hide view source menu?





shamil
if i don't want others to view my page's source code. what i have to do. they say it is not possible. but still i can find sites that view source menu is not active. how it is done?
Ranfaroth
I confirm that it's impossible.
Give me those site and I'll give you their source code.
Stubru Freak
It are javascript tricks that only work in IE. But even in IE you can deactivate them.
Monster
You cant hide the source, One thing you can do is scrammble/encrypt your source... Heres a simple one: http://dynamicdrive.com/dynamicindex9/encrypter.htm
mathiaus
I'll agree that its impossible to hide your source code. there are many scripts to not display the 'show souce' link but there are other ways and javascript can be disabled anyway. Basicly if you dont it being used do as the person aboe said and encrypt (just use a better encryptor). The only problem comes when you need to change for whatever reason.
charliehk
I agree that it is impossible to prevent others to view your source code. Someone could always Save your web pages to hard disk and even edit it using Web page editor. I don't know whether encryption works, but if you really want to keep the code to yourself, consider using server-side scripts like php, jsp, etc.
KHO
actually you can, it takes a little extra work and l've never tried this so l don't know for sure, but...

lf you use the php function "include" like so <?php include("document.htm") ?> on a blank page it will work. so if you make a php document all by itself for every page, then you use the include function to include the real page, then they won't be able to view the source.

Because php is left behind by the time it gets to the browser and the server handles it, they won't be able to see which page is being called.

So just create an extra .php page for every page and use that instead of the real page and it will work (in theory).

lf this helped you, donations are always appreciated Neutral
shamil
<?php include("document.htm") ?>

Above doesn't work. Please post if you know the solution.
mathiaus
@Shamil
Code:
<?php include('document.htm'); ?>


@KHO
You can still see the html. You cant see php anyway if its included or not but the html will still show
shamil
I understand from posts that it is impossible to deactivate the View->Source menu. But i still remember that i have seen it deactivated. So looking forward to come across with it again and investigate.
Stubru Freak
shamil wrote:
I understand from posts that it is impossible to deactivate the View->Source menu. But i still remember that i have seen it deactivated. So looking forward to come across with it again and investigate.


No, it is possible, but it doesn't work in every browser, and it doesn't prevent people from viewing your source in any browser.

Here are some scripts: http://www.hypergurl.com/norightclick.html

For more information about why it can't possible be done: http://dorward.me.uk/www/hide/
shamil
Stubru Freak wrote:


No, it is possible, but it doesn't work in every browser, and it doesn't prevent people from viewing your source in any browser.

Here are some scripts: http://www.hypergurl.com/norightclick.html

For more information about why it can't possible be done: http://dorward.me.uk/www/hide/


I don't want to disable right click.
Ranfaroth
A browser which would allow a stupid script to disallow one of its menus would be a very insecure browser...
charliehk
For preventing "View Source", it is not working. It will only "fool the fools" according to http://www.hypergurl.com/norightclick.html

But in fact, I have seen a website successfully preventing View Source although I don't know how it works.
Stubru Freak
charliehk wrote:
For preventing "View Source", it is not working. It will only "fool the fools" according to http://www.hypergurl.com/norightclick.html

But in fact, I have seen a website successfully preventing View Source although I don't know how it works.


Could you give the website? Then i can get the script from the source.
S3nd K3ys
Even calling other files is not going to work. I made a (very simple) visual basic program to download any file. All you need to do is find the file name. Wink

Bottom line: It's impossible to hide the source.
KHO
shamil wrote:
I understand from posts that it is impossible to deactivate the View->Source menu. But i still remember that i have seen it deactivated. So looking forward to come across with it again and investigate.

Regardless, my Fire Fox developer tools can view the source, you can never hide it from them. And yes l forgot to ad the ';' sorry, still new to php and it was about 3:00AM Neutral and yes, l just tested it and it doesn't work, sorry. lt was still worth a shot Neutral
Stubru Freak
KHO wrote:
shamil wrote:
I understand from posts that it is impossible to deactivate the View->Source menu. But i still remember that i have seen it deactivated. So looking forward to come across with it again and investigate.

Regardless, my Fire Fox developer tools can view the source, you can never hide it from them. And yes l forgot to ad the ';' sorry, still new to php and it was about 3:00AM Neutral and yes, l just tested it and it doesn't work, sorry. lt was still worth a shot Neutral


It doesn't work because, you are right about that, php is parsed by the server. So the server includes the code from the other file before sending to browser. But it was a nice try. Very Happy

Btw, bookmark this link and you can disable most context menu (right click menu) disablers and selection disablers (just make a new bookmark (or favorite in IE), and fill in this in the URL field):
javascript:document.oncontextmenu=void(0); document.onmousedown=void(0); window.onmousedown=void(0);
If you're on a page like that, just open it from your bookmarks (or favorites for IE), like it is a web page, and it will disable the protections.
charliehk
This is an example of disabling right-click.

http://www.ab-world.co.uk/

I found that I couldn't view the source code after I did a right-click (before that I am able to view the source code)

But I don't know which part of the code did the trick. If anyone knows, please show me, thanks!
BearClaw
cannot be done, thats why its best to keep any sensitive information handled by a serverside programming language such as php/asp, as opposed to a client side language such as java. this way the actual hard code cannot be viewed unless the page itself is downloaded via ftp or some other transfer process, http requests are always processed prior to the page being loaded by the client.


sooooo thats why i say java/javascript is the devil!
BearClaw
oh yea...about disabling the right click menu...

that only limits those who are mildly retarded when it comes to computers, or their keyboard is lacking the mini-menu button, usually located in the lower righthand side of the keyboard, under the right shift button.

the source can also be viewed from the view menu at the top of the page. i mean if you really want to try to limit the funtionality you would use frames to hold any of your classified information and also disable the right mouse button. this way if view source is selected from the view menu, only the main pages' source will be viewed which will show that a frame is being used. in this situation the person would have to mouse over the frame and use the mini-menu button on their keyboard. or go to the link in the source of the main document that the frame is pointed to and load that page and view the source...

again it all depends on the level of knowledge, and the will to find the code by the user.

p.s. sorry if the above was a little hard to read...i've had a few drinks and i'm not quite on top of my game
Texas Al
1. If you're trying to hide the source of your web page, you're severely misunderstanding what this whole web thing is about.

2. The best you can hope for is to make your page "not worth the trouble"-- just use some CMS or Blog software that generates thousands of lines of not-quite-valid XHTML with CSS and tables and inline formatting and gratuitous Javascript thrown in for good measure. People trying to "steal" your source will take one look at it and go "****** it, this will take forever". And it's easy to find a CMS that generates inscrutable code: they all do.

3. Or why not go all the way? Program the whole thing in Flash. Normally I recommend avoiding Flash like it was full of AIDS, but in this case it would be a good fit with where I see this going. Wink


PS: No disrespect intended, I'm just feeling sarcastic. But that doesn't mean what I'm saying isn't true.
Stubru Freak
charliehk wrote:
This is an example of disabling right-click.

http://www.ab-world.co.uk/

I found that I couldn't view the source code after I did a right-click (before that I am able to view the source code)

But I don't know which part of the code did the trick. If anyone knows, please show me, thanks!

Code:

<SCRIPT src="rightmenu.js" type=text/javascript>

//Right-click menu- By Eyecon (http://www.webteam.ro)
//Slight modifications by JK
//Visit JavaScript Kit (http://javascriptkit.com) for script

</SCRIPT>


rightmenu.js:
Code:
//eyesys dhtml  (c)eyecon 2002 [ eyecon@webteam.ro ]
//visit www.webteam.ro for great scripts and tutorials

var ie5=window.createPopup

if (ie5)
document.oncontextmenu=init;
var eyesys="";
var preitem="";
function init(){
mx=event.clientX;
my=event.clientY;
menx=window.screenLeft+mx;
meny=window.screenTop+my;
sysmen=window.createPopup();
sysmen.document.write(eyesys);
sysmen.show(menx,meny,eyesys_width,document.getElementById('men').offsetHeight);
return false
};
function eyesys_init(){
if (ie5){
eyesys+=("<style type='text/css'>.textul{position:absolute;top:0px;color:"+eyesys_titletext+";writing-mode:   tb-rl;padding-top:10px;filter: flipH() flipV() dropShadow( Color=000000,offX=-2,offY=-2,positive=true);z-Index:10;width:100%;height:100%;font: bold 12px sans-serif}.gradientul{position:relative;top:0px;left:0px;width:100%;background-color:"+eyesys_titlecol2+";height:100%;z-Index:9;FILTER: alpha( style=1,opacity=0,finishOpacity=100,startX=100,finishX=100,startY=0,finishY=100)}.contra{background-color:"+eyesys_titlecol1+";border:1px inset "+eyesys_bg+";height:98%;width:18px;z-Index:8;top:0px;left:0px;margin:2px;position:absolute;}.men{position:absolute;top:0px;left:0px;padding-left:18px;background-color:"+eyesys_bg+";border:2px outset "+eyesys_bg+";z-Index:1;}.men a{margin:1px;cursor:default;padding-bottom:4px;padding-left:1px;padding-right:1px;padding-top:3px;text-decoration:none;height:100%;width:100%;color:"+eyesys_cl+";font:normal 12px sans-serif;}.men a:hover{background:"+eyesys_bgov+";color:"+eyesys_clov+";} BODY{overflow:hidden;border:0px;padding:0px;margin:0px;}.ico{border:none;float:left;}</style><div class='men'>")
}
};

function eyesys_item(txt,ico,lnk){
if (ie5){
if(!ico)ico='s.gif';
preitem+=("<a href='#' onmousedown='parent.window.location.href=\""+lnk+"\"'><img src='"+ico+"' width='16' height='16' class='ico'> "+txt+"</a>")
}
};

function eyesys_close(){
if (ie5){
eyesys+=preitem;
eyesys+=("</div><div class='contra'><div class='gradientul'></div><div class='textul' id='titlu'>"+eyesys_title+"</div></div>");
document.write("<div id='men' style='width:"+eyesys_width+"'></div>");
document.getElementById('men').innerHTML=preitem
}
}
charliehk
Thanks, but which part of the code (or which statement) disable right click; and which part of the code (or which statement) disable "View source code"?
Stubru Freak
charliehk wrote:
Thanks, but which part of the code (or which statement) disable right click; and which part of the code (or which statement) disable "View source code"?


document.oncontextmenu=init;
Calls the init() function when trying to right click.

Disabling source code: no idea
shamil
Stubru Freak wrote:
charliehk wrote:
Thanks, but which part of the code (or which statement) disable right click; and which part of the code (or which statement) disable "View source code"?


document.oncontextmenu=init;
Calls the init() function when trying to right click.

Disabling source code: no idea


I couldn't see any code that it can prevent viewing source. May be it is one of the bug of ie. Rolling Eyes
Stubru Freak
shamil wrote:
Stubru Freak wrote:
charliehk wrote:
Thanks, but which part of the code (or which statement) disable right click; and which part of the code (or which statement) disable "View source code"?


document.oncontextmenu=init;
Calls the init() function when trying to right click.

Disabling source code: no idea


I couldn't see any code that it can prevent viewing source. May be it is one of the bug of ie. Rolling Eyes


Think so too
oasis
I think its better if you use the html protector program,

here to download it :
http://www.antssoft.com/download.htm
S3nd K3ys
oasis wrote:
I think its better if you use the html protector program,

here to download it :
http://www.antssoft.com/download.htm


I wonder why they don't use their own features on their own web site? Rolling Eyes

If anyone is using this, please let me know so I can go get your source code...
S3nd K3ys
S3nd K3ys wrote:
oasis wrote:
I think its better if you use the html protector program,

here to download it :
http://www.antssoft.com/download.htm


I wonder why they don't use their own features on their own web site? Rolling Eyes

If anyone is using this, please let me know so I can go get your source code...


I just spent the last 10 minutes visiting and viewing the source of every page I tried in their "customer's" list.
PatTheGreat42
Just to throw in my two cents: Yeah, it's impossible to hide your source code. Your browser has to download the document in order for you to see it, and if the document is sitting on your harddrive, you can open 'er up.

If you're REALLY paranoid, the advantage of Flash is that you can't just right-click it and view the source; it's made of animations and such, and if they did view the source for the page, all they would see is a body tag and the tag the shows the Flash.

If it's some uber-amazing scripting you're trying to hide, I say go with PHP. Because it's a server-side script, it only sends the browser the boiled down information, only the information that you tell it to send to allow the user to view a page.

But the real question is: Why would you want to hide your source code? Imitation is the sincerest form of flattery, and if you see other sites with your source, take it as a compliment.

But if you really want to be crafty, here's an idea: If I knew how, what I would do is insert a signature into the code that says something along the lines of "This code was made by PatTheGreat. Visit PatTheGreat.com!" Then, I would write a bit of code that made the whole webpage fall apart unless that was in there.

That way, anyone who steals the code from the person who stole the code would know who created the site. And for those smart enough to bypass such things, I would hope they wouldn't have to stoop so low as to not include some sort of bibliography.

That probably earned by 2 Frih points.
Alya
shamil

А person knowledgable enough to want to steal your source code will probably know how to have a proper set-up in the browser so that the context menu cannot be altered or disabled

For example Multizilla extension for Mozilla\Seamonkey browser that I use has an option to always preserve the original context menu. And it works - you can try it

Ijust checked that example of allegedly disabled right-click (earlier posts) http://www.ab-world.co.uk/

well right-click is NOT disabled in my browser, I still have my original context menu - and I didn't even disable java script (but I did disallow their java applets)
Stubru Freak
Alya wrote:
shamil

А person knowledgable enough to want to steal your source code will probably know how to have a proper set-up in the browser so that the context menu cannot be altered or disabled

For example Multizilla extension for Mozilla\Seamonkey browser that I use has an option to always preserve the original context menu. And it works - you can try it

Ijust checked that example of allegedly disabled right-click (earlier posts) http://www.ab-world.co.uk/

well right-click is NOT disabled in my browser, I still have my original context menu - and I didn't even disable java script (but I did disallow their java applets)


Lol you don't need an extension for that, bad written IE-only code...
Alya
Stubru Freak

Yes, I'm sure with IE's bad-written code everything is possible Smile
That's why I don't use IE

But with Mozilla you need an extention - before I started using Multizilla I had that problem on some sites, that they'd disable or alter Mozilla's context menu
Stubru Freak
Alya wrote:
Stubru Freak

Yes, I'm sure with IE's bad-written code everything is possible Smile
That's why I don't use IE

But with Mozilla you need an extention - before I started using Multizilla I had that problem on some sites, that they'd disable or alter Mozilla's context menu


No, I mean, not that site, it has IE-specific code, I use firefox without any extension and I have the normal context menu.
Alya
oh, I see what you mean - I guess many sites wouldn't bother writing extra code to disable context menu in a minority browser like Mozilla\Seamonkey. So using non-IE browser will help too
Grimboy
What advantage would hiding your source code actually have? I have to agree with Texas Al here as he is spot on. But really, anything to do with security needs to be on the server side anyway so it's no biggy if someone comes along and says "this looks pretty" and nicks it, you can stop hotlinkers and there's nothing you can do in html or even javascript that someone else couldn't do themselves.

So stop playing old man in a council house with large rottweiler.
zorindart
There are some tools that encrypts your html code. You might give them a try.
Anyway, there must be a very few things you could do with html that havn't been already done, and just in the case you think you've done something absolutely new, you can be sure another guy will be doing the same soon. It's just a matter of numbers, so who cares?
afracsass
The reason why i have a look at this thread is to know how to disable the i.e source view menu ,just for my curiosity. when i visit some sites i was surprised 'cause i couldn't see the source code, like the one above 'http://www.ab-world.co.uk/ '. disabling right click context menu in i.e is kinda simple but to disable drop down menu "view -source" in i.e is interesting. I don't need to disable the menu on my webpage but i'm just curious how do they work it out. Looks like nobody here knows how to do it, but just keep saying there's no use hiding source code and it's always possible to crack out the source code. are they using some kind of java applet to disable the i.e view source drop down menu? hmm....
Stubru Freak
afracsass wrote:
The reason why i have a look at this thread is to know how to disable the i.e source view menu ,just for my curiosity. when i visit some sites i was surprised 'cause i couldn't see the source code, like the one above 'http://www.ab-world.co.uk/ '. disabling right click context menu in i.e is kinda simple but to disable drop down menu "view -source" in i.e is interesting. I don't need to disable the menu on my webpage but i'm just curious how do they work it out. Looks like nobody here knows how to do it, but just keep saying there's no use hiding source code and it's always possible to crack out the source code. are they using some kind of java applet to disable the i.e view source drop down menu? hmm....


I don't know what your pc does, but on my IE I can perfectly see the source.
afracsass
Sad now i can see the code too. what happened? i have no idea. any way i couldn't download the page using save as menu. Can you?
But i'm sure that there are some web site that disable the view-source menu and when you click it nothing pops up.

i just figured it out that after right click the drop down menu does not work....
shamil
afracsass wrote:
The reason why i have a look at this thread is to know how to disable the i.e source view menu ,just for my curiosity. when i visit some sites i was surprised 'cause i couldn't see the source code, like the one above 'http://www.ab-world.co.uk/ '. disabling right click context menu in i.e is kinda simple but to disable drop down menu "view -source" in i.e is interesting. I don't need to disable the menu on my webpage but i'm just curious how do they work it out. Looks like nobody here knows how to do it, but just keep saying there's no use hiding source code and it's always possible to crack out the source code. are they using some kind of java applet to disable the i.e view source drop down menu? hmm....


I understand you. I was also thinking like you. Now I understand that it is not possible to hide view source menu. You may disable right click as it is not surprising. Sometimes it is possible to see that view source menu doesn't work. I think it is due to errors in the page or any of the browser bugs. I even witnessed it when creating my site(sometimes vs menu didn't work).
Browser needs source code to to interpret it. Disabling it via script will ensure browser vulnerability to insecure scripts(as one of the guy told).
I think now you think what we think (a wink ) Wink
Astrolopitecos
i must disagree with almost everyone.its not impossible

u can use an real old trick to do what u want
u just need to do the index like a frame page
and the 1st frame will load the rest

when ppl tries to see your source will only show the source
for the frame page, even if people goes file->save web page
will only save the frame page Wink

old tricks that will always be around Smile
rheanna
you can still view a source code by going to the tool bar to

edit>view source


unless you put it in a frame but I bet there's some way around that too.
Astrolopitecos
rheanna wrote:
you can still view a source code by going to the tool bar to

edit>view source


unless you put it in a frame but I bet there's some way around that too.


you will only see the frame page source

u cant see what its being loaded since is an outside source file Wink
MrBlueSky
Astrolopitecos wrote:
rheanna wrote:
you can still view a source code by going to the tool bar to

edit>view source


unless you put it in a frame but I bet there's some way around that too.


you will only see the frame page source

u cant see what its being loaded since is an outside source file Wink


In that case you can copy paste the url of the frame you want to see from that frame page source to your browsers location field. Smile

But just telnetting to port 80 is even easier Very Happy
Ranfaroth
Astrolopitecos wrote:
i must disagree with almost everyone.its not impossible
Yes it is
Quote:
u can use an real old trick to do what u want
u just need to do the index like a frame page
and the 1st frame will load the rest
I can't realise people don't know the view this frame source nowdays...
Quote:
old tricks that will always be around Smile
Old tricks are deprecated by modern browsers...
qebab
Quick question:

How would the browser know how to display a web page without being able to interpret the HTML code? The logical conclusion is that it wouldn't, and it thus needs the source. If the browser can access the source, the user can view it.

The PHP code will never show, and writing good html is just a matter of practise, there is no reason to hide html source (in fact life would be easier for all of us if everyone used good html).
Related topics
no click right mouse
Windows Tips&tricks!
The worlds shortest and laziest Mambo tutorial.
Basic HTML Introduction
751 Useful Windows XP Files
Is it a Bug or Easter Egg?
WEBSITE HELP NEEDED!
Internet Explorer 7 (beta 2 preview)
I need a fool-proof anti-source view javascript.
Hide source??
How to avoid people stealing your images?
links dont work in IE from frihost hosted site
how to hide Javascript code into GIF Image?
need help
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.