• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Disable view sources in web

 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since I need some info shown on web, the users can print it and sign a signature back to office. I don't want anyone who view the source and paste it into an editor and change the data and reprint it.
Does anyone know how to disable view source (View->View Source in toolbar or right click of a mouse) after displaying data from JSP ?
 
Ranch Hand
Posts: 1061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sophia,
generally, the page the browser shows is on the clients computer! And the user can look at it's sourcecode...at the latest in the Temporary-Internetfiles-Directory, but...
your displaying page could contain something like this:

Then pack it in a Frameset.
But i wouldn't guarantee you this to be safe, also because some funky browsers may be unable to interprete margin for <body> correctly
cb
[ May 07, 2003: Message edited by: Christian Baron ]
 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can disable the right mouse button click by using a little piece of JavaScript see here for an example Codelifter.com - norightclick
I think disabling the menu option is a bit harder. You could try using a frameset which only includes a single frame that has the source as your page then when the user clicks on the View/Source option they would only see the source code of your frameset. [NB You would also need a bit of JavaScript at the top of your page to ensure that the users cannot view it without going through the frameset i.e. check the parent of the current window]
I personally don't like doing this as the Right Mouse button is used for more than just viewing the source code but if it is essential for you application give it a try.
HTH
Andy Bowes
 
Chris Baron
Ranch Hand
Posts: 1061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@andy


You can disable the right mouse button click by using a little piece of JavaScript


But this is useless if you switch off JavaScript
in the browser-settings
cb
 
Andy Bowes
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
True
 
Sophia Choi
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Andy,
You are right if I use the frameset. I can see the frameset source from View-> ViewSource in the toolbar. But when I use right-clicked mouse inside the content of each frames, I can see its content.
Would you like evaluate a bit about how to disable them in JavaScript ?
Thanks a lot.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It IS IMPOSSIBLE, this discussion should be in the HTML Javascript forum,
The only safe way is to not sgow it and burn the computer to a lump of plastic it was crated on. The reaon why is there are countless programs out there that can get the source code. Antio right scrips do not work if javascript is disabled, removing the tool bars does not work in all browsers. THe code is in the temp file. A person can just look through it and find it. They can save the page, they can priont screen the page. The list goes on and on....
If you want to waste your time with this then do a search online for disable right click, but it does not work for certain mice with number of buttons, OH and the great thing is some people have hot keys on their keyboard that show the source.
You can do a trick that makes everything look jumbled when selected by taking all of the spaces and replacing them with jumbled letters that match the background. They will look like spaces, but they are actaully text.
Stuff that is displayed on a browser is open source.....The way it should be....My 2 Cents
Eric
 
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Andy Bowes:
You can disable the right mouse button click by using a little piece of JavaScript see here for an example Codelifter.com - norightclick
I think disabling the menu option is a bit harder. You could try using a frameset which only includes a single frame that has the source as your page then when the user clicks on the View/Source option they would only see the source code of your frameset. [NB You would also need a bit of JavaScript at the top of your page to ensure that the users cannot view it without going through the frameset i.e. check the parent of the current window]
I personally don't like doing this as the Right Mouse button is used for more than just viewing the source code but if it is essential for you application give it a try.
HTH
Andy Bowes


You can use SHIFT + F10 on windows machine to emulate right click. Believe me, it is *NOT* possible. I agree with Eric on this one -


Stuff that is displayed on a browser is open source.....The way it should be....My 2 Cents
Eric


- Manish
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the HTML forum.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Eric said, this simply cannot be done.
You can be rude and disable right-clicks, and try to pervert the browser window all you want, but when it comes down to it, the source needs to be downloaded to the computer and is available to anyone who wants to put even a little effort into getting at it.
So why annoy your users trying to?
hth,
bear
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This question is equivalent to:
"I�ve sent a file to a friend and i dont want him to see it"
Since the file is ALREADY in his computer, there�s no way you can limit his rights.
Any *protection* you put in the source code is irrelevant, remember the HTTP protocol
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I downloaded htmlsource viewer from http://www.goorbis.com/, this tool can view html and javascript easily no matter what you do in your code.

There is another tool IEWatch at
http://www.iewatch.com/index.html#

I just want to know which one is better, and is there any other wonderful tools on the market?

Can someone help me choose the right tool? I need view the javascript file as well as html source.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are tons of site grabbers out there that you point it at a site and it starts to download everything.

The easiest thing to do is to goto the site. Do a view source and look for the js files. Type that link into the browser and it asks you to save it. Then you can look at how they do the code.

My 2 cents,
Eric
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic