Preventing some source code from being viewed

Posted on 2014-07-21
Last Modified: 2014-07-25
Hello experts.

I'm hoping you may be able to help me with an issue with Firefox.

We use an online reporting system called Dapresy and we use it to provide our clients with access to their customer data (we run satisfaction surveys).

We want to benchmark these clients against each other using this online system and we want it to be completely anonymous.

We've managed to make a chart that has all the scores on screen and you cannot see which score applies to which client. If you view the source code, it seems to show the source for only a certain part of the page - which is great!

However in firefox, if you press CTRL+A then click "View Selection Source" it shows the source code for the charts and then unfortunately shows the order in which the clients are.

We have the power to edit CSS and we can also put in some Custom HTML into the projects we have in the system.

I know it's probably useless having this without experts knowing anything about Dapresy (the online system), but I didn't know if there was any generic javascript, or CSS or other people who may have come across a way to prevent the "View Selection Source" option.
Question by:INHOUSERES
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
LVL 40

Accepted Solution

Kyle Abrahams earned 500 total points
ID: 40209177
What if you obfuscate them before you present them in the chart?

EG:  Have another field called CustomerReportingName in the database.
Populate it with random (unique) data for each client.

Use that instead, now the data means nothing unless you have access to the database.
LVL 58

Expert Comment

ID: 40209180
If it's in the browser there is nothing you can do to prevent people seeing the source
There are js routines that can disable right click on the page but it takes all of 2 seconds to get around it

Expert Comment

by:c l
ID: 40209188
the general answer is "no", there wil always be a way to, once a page request has been made, to view that code. There are javascript techniques that you can use to discourage people from viewing source, but those people tech savy enough will generally find a way around those "discouraging" techniques. once the page has been served to the end user, anyone can just locate that page in their temp directory and view it from there.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 40209211
Thanks for the swift responses.

Kyle - It's kind of a WYSIWYG program so we don't have raw access to the databases. We upload data in .sav and one of the options I was thinking of would be to give clients a 5 letter/digit code to represent their company. This would probably change each month to keep it fresh.
This would be a last resort though.

Gary/CL - I thought this would be the case, but if you view the source without selecting then you don't see it. It works perfectly in IE and Chrome because you don't have the function to View Selection Source.
I also added this to the CSS to try and prevent highlighting. This only works properly in Chrome though:

-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;

You cant click and drag to highlight in Firefox or Chrome, but you can in IE.
If I could prevent highlighting in Firefox, it may be enough prevention to ensure it's anonymity. Although it's not impossible, it's incredibly improbable that a client of ours would go to such lengths to find out who it who... However the more I can prevent, the better.
LVL 58

Expert Comment

ID: 40209241
It must be loading in a frame or through ajax? Cannot tell from their site since they don't show an example That would explain why it's not directly visible in the browsers view source
The css you have covers all browsers so it should work in IE

Other option is to overlay a transparent div covering the page so you cannot actually select anything.
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 40209242
Same approach . . . if the data is in .SAV then update .sav and replace the customer's name with something else.  You're generating the .SAV from somewhere.  

I would NOT recommend trying to just hide the data.  Any JS function can be disabled, and with firebug you can pretty much do anything you want.  The only way to truly secure this is to change / obfuscate the data before it's presented to the user.
LVL 53

Expert Comment

ID: 40209800
If you find a way to do this please notify me and we will patented the method and becomes billionaires.  Seriously, a browser; ANY BROWSER is designed to do exactly what you are trying to prevent.  You can spend all the time and effort you want, but it will be a waste, because if you find something that succeeds you will also have a method that prevents the browser from rendering the page.

On each of my browsers I have a button from an addon.  When I click on the button it list my cache and I can do anything I want with the content from a site.  A common addon?  if you do a search for cache viewer Google will return about 10 million hits listing versions for every browser in the universe.  Given the amount of effort to create that many variations, I would say the demand is high enough that they are commonly in use.  However if you find a way we can get rich in a hurry.


Author Comment

ID: 40218750
Probably have to to shelf this then...

The only way is to try and manipulate the data before it's HTMLised.

Looks like "Obfuscate" will be a new word in my vocab.

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question