473,654 Members | 3,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disable View source

Hello to everybody,
I have some question concerning blocking view source from main menu of
IE or MF. I am able to block right click with <body
oncontextmenu=" return false"> but still missing from main View->Source
Code.
Any hints ?
Regards,
Roman

Jan 12 '06 #1
24 16078
Roman wrote:
Hello to everybody,
I have some question concerning blocking view source from main menu of
IE or MF. I am able to block right click with <body
oncontextmenu=" return false"> but still missing from main View->Source
Code.
You only think you can, you can't prevent that reliably at all. There
are many ways of viewing the source other than via right-click or
browser menus.

Any hints ?


Yes, don't even try. Anything you publish on a web server can be viewed
and saved by someone visiting the site. If you don't want that, don't
publish it.
--
Rob
Jan 13 '06 #2
"Roman" <ro************ *@gmail.com> wrote:
Hello to everybody,
I have some question concerning blocking view source from main menu of
IE or MF. I am able to block right click with <body
oncontextmenu=" return false"> but still missing from main View->Source
Code.
Any hints ?


Don't waste your time and don't annoy your visitors. Your source is
probably not worth to be stolen in the first place.

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Jan 13 '06 #3
Ivo

"Roman" <ro************ *@gmail.com> asks
I have some question concerning blocking view source from main menu of
IE or MF. I am able to block right click
Sorry, but no, you are not.
with <body oncontextmenu=" return false"> but still missing from main
View->Source Code.
Any hints ?


There is no way you can hide your source from us or anybody. All you can do
is discourage people. If the browser is to display a page, the raw code must
be present on the user's hard disk, if directly not accessible from the main
menu due to scripts, frames and whathaveyou, then certainly from the
Temporary Internet Files folder, or by whatever name the cache may be known
locally.

And this little beauty of a bookmarklet restores all kinds of menus:

javascript:(fun ction(w){for(va r%20i=0;i<w.len gth;i++){argume nts.callee(w.fr a
mes[i]);}try{function %20n(r){r.oncli ck=r.oncontextm enu=r.onmousedo wn=r.onmou
seup=null;}n(w. document);n(w.d ocument.body);} catch(e){alert( 'Bookmarklet%20 f
ailed:\n\n'+e.m essage);}})(top );

Really, it is more productive to put your energy into more fruitful
endeviours such as authoring innovative pages that people will want to come
and see, than hiding source code. If it is confidential, it doesn't belong
on the web.
--
hth
ivo
http://4umi.com/web/javascript/
Jan 13 '06 #4
RobG <rg***@iinet.ne t.au> wrote:
Roman wrote:
Hello to everybody,
I have some question concerning blocking view source from main menu of
IE or MF. I am able to block right click with <body
oncontextmenu=" return false"> but still missing from main View->Source
Code.
You only think you can, you can't prevent that reliably at all. There
are many ways of viewing the source other than via right-click or
browser menus.
Any hints?


While anyone with a will can see everything you've published and there's
nothing you can do stop that, there are several things you can do to
dissuade the casual looky-Lou from peaking at your code.
Yes, don't even try. Anything you publish on a web server can be viewed
and saved by someone visiting the site. If you don't want that, don't
publish it.


I think there should be a way to hide proprietary code. The need exists
and it's going to get bigger as hosted software becomes more commonly
used.

I'm about to market web-hosted medical diagnostic software that employs a
few proprietary algorithms. I've taken great measures to assure the app
isn't stolen, but I know that somewhere out there is a 13-year old,
pimply-faced kid wearing big glasses and a big grin who could get the code
if the mood struck him.

I wonder how owners of web-hosted applications are going to secure the
integrity of their ownership...

--
Ed Jay (remove M to respond by email)
Jan 13 '06 #5
Ed Jay <ed***@aes-intl.com> wrote:
I wonder how owners of web-hosted applications are going to secure the
integrity of their ownership...


They host the data as well.

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Jan 13 '06 #6
Ed Jay wrote:
RobG <rg***@iinet.ne t.au> wrote:

Roman wrote:
Hello to everybody,
I have some question concerning blocking view source from main menu of
IE or MF. I am able to block right click with <body
oncontextmen u="return false"> but still missing from main View->Source
Code.
You only think you can, you can't prevent that reliably at all. There
are many ways of viewing the source other than via right-click or
browser menus.

Any hints?

While anyone with a will can see everything you've published and there's
nothing you can do stop that, there are several things you can do to
dissuade the casual looky-Lou from peaking at your code.


What sort of threat - security or competitive - do such persons present?
How does preventing access to source code prevent anyone from
implementing a copy of your site? Getting the source code has never
been a requirement for knocking-off your competition.

Yes, don't even try. Anything you publish on a web server can be viewed
and saved by someone visiting the site. If you don't want that, don't
publish it.

I think there should be a way to hide proprietary code. The need exists
and it's going to get bigger as hosted software becomes more commonly
used.


A couple of methods spring to mind - there are others:

1. Provide downloadable binary executables - failed
2. Applets (Java, ActiveX) - rare, mistrusted
3. Xwindows and suitable X-client - never got off the ground
4. CORBA/IIOP barely drew breath - total failure

I'm about to market web-hosted medical diagnostic software that employs a
few proprietary algorithms. I've taken great measures to assure the app
isn't stolen, but I know that somewhere out there is a 13-year old,
pimply-faced kid wearing big glasses and a big grin who could get the code
if the mood struck him.
What will he/she do with it? How come eBay takes no precautions what so
ever? Or Google? Or even MSN? Because the value is in the service,
not the code.

You may as well complain that your competitors copied your idea of
putting in a front door to let the customers in. :-)

I wonder how owners of web-hosted applications are going to secure the
integrity of their ownership...


Those that try fail. Winners base their business on providing the best
service - their sites are kept up-to-date, they run efficiently in
(nearly) any browser, they offer useful content, they are open and
welcoming.

--
Rob
Jan 13 '06 #7
VK

Ivo wrote:
There is no way you can hide your source from us or anybody. All you can do
is discourage people. If the browser is to display a page, the raw code must
be present on the user's hard disk, if directly not accessible from the main
menu due to scripts, frames and whathaveyou, then certainly from the
Temporary Internet Files folder, or by whatever name the cache may be known
locally.


To be fair there is a way to have View > Page Source grayed out (not
available). But it is not achievable by client-side scripting. One need
to send a right sequence of response headers from the server. It is
also not supported by all browsers, and where supported it smashes down
the browser caching mechanics.

But it is an absolute true: service is the key to success, not a copy
protection. One should go by the presumption of innocence and do not
look at *your* future visitors as a bunch of thiefs. (But still think
of them as of a bunch of experienced server hackers - it is paranoidal
and it is *not* true, but it's the way to build a secure server
solution).

It is very difficult to believe when reading Internet news :-), but in
the most part these are the same people used to work for money and
respect someone else's property. The rest sign off for "shrink" (as
it's called in grocery stores).

Jan 13 '06 #8
VK wrote on 13 jan 2006 in comp.lang.javas cript:
To be fair there is a way to have View > Page Source grayed out (not
available). But it is not achievable by client-side scripting.


Try this to gray it out:

<http://devrijehuisarts .org/test/noViewSource.as p>

[sorry, no clientside script]

;-)

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 13 '06 #9
VK

Evertjan. wrote:
Try this to gray it out:

<http://devrijehuisarts .org/test/noViewSource.as p>


Right, I meant similar trick, and (besides other drawbacks) IE is the
only one (at least on Windows) who buys it.

Jan 13 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
13702
by: yaktipper | last post by:
This explains how to disable the view source / right-click menu in Netscape 4, Netscape 6 and Internet Explorer (IE). <script language="JavaScript"> //This code is the beginning of the right click disable function right(e) { //This function is for Net 4. if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) {
1
8151
by: KS | last post by:
I write my html pages as .jsp files (java server pages). The final result when the page is rendered in the browser, and I do a view source, is nothing less the normal HTML codes. The problem is I have a .jsp file A called main.jsp which contains one form an serveral buttons. Main.jsp include a another .jsp file B called Internal.jsp which has its own form and several buttons. I have made a javascript that disables all buttons on A and B...
6
3153
by: nntp | last post by:
I have a set of links which I want search engines to crawl them, but I want to disable them from my visitors, so I will ask the link owners to pay me to let me enable them. <a disabled href="#">bahbahbah</a> Does not work, as it is still clickable. It only changes the color to grey.
29
9768
by: lori3laz | last post by:
How do you disable the right click>view source option on web pages so people can't view your coding and copy it? What's the html I need to include in my website to utilize this feature? Thank you.
1
445
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I disable the right mouse button? ----------------------------------------------------------------------- The oncontextmenu intrinsic event is the only safe and reliable method. Of the other approaches often presented, most depend on an alert box interrupting the process and rarely work. Note that oncontextmenu is a non-standard event and is not...
4
3828
by: Joe | last post by:
Hi, I have a customer who wants the View Source button disabled when people view his website. I explained to him how in ASP.NET the "real" code is in the code-behind module and not visible to the end-user anyway, but he really wants that View Source button disabled. Can anyone tell me how to do this?
4
2283
by: =?Utf-8?B?TUNN?= | last post by:
I am trying to disable ViewState at the application level. I have the following line in my web.config: <pages enableViewState="false"></pages> But it is not working. What can I do?
3
3656
by: visweswaran28 | last post by:
i want to disable save as option and view source option from menu could any one help.....
0
8376
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7307
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2716
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.