aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Detecting browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Detecting browser" Watch "Detecting browser" New topic
Author

Detecting browser

Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
if the browser is not Microsoft Internet Explorer then don't show the website but message to view website with Microsoft Internet Explorer

Any example code

Thanks & best regards
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39567
    
  27
How about coding a web site that can be viewed with all browsers? Why do you want to purposefully exclude people from seeing your web site?


Ping & DNS - updated with new look and Ping home screen widget
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
Originally posted by Ulf Dittmer:
How about coding a web site that can be viewed with all browsers? Why do you want to purposefully exclude people from seeing your web site?


Actually I am trying to protect my images. I know there are numerous ways to get images but to the maximum possible extent for a layman I want to use some Java scripts e.g. disabling print screen and right click etc. but fire fox and other browsers doesn't recognise them that's why am trying that user should be able to see my images only and only in MS internet explorer and not in other browser

Thanks again & best regards
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Search the net.

Sad thing is if I disable JavaScript, I can get pass this check of your with no issue. You are wasting so much time on something that has no solution.

Eric
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39567
    
  27
What you're trying to do is fundamentally at odds with how the web works. If it is acceptable that some people can't see the images because they use a particular browser, then I concur with the advice given to you elsewhere: don't show them at all.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29274
    
140

Farakh,
Firstly, why are you trying to protect the images? Do they contain secure information that requires a login? Do they cost money? If it's either of these, you can protect the images by only allowing logged in users to see them. Yes, they can save them. You have to expect logged in users to have some sense of responsibility. And if you are selling them, you can embed user specific information in the image itself to see who is provide unauthorized copies.

I'm also curious why you don't want the user printing the page. That's not distributing it to others electronically. This is impossible to block anyway (you can just do a print screen.)

You can detect browsers on the server side (without JavaScript), but not reliably. A number of browsers provide an option to masquerade as IE because people insist on having their websites be IE specific.

but to the maximum possible extent for a layman

I don't understand why. A person motivated to steal your data is more likely to be technical. Or at least have someone technical to ask. And more and more people are technical enough to get around these days.

My point is that if you make the site hard to use, a couple things might happen:
1) Firefox/Opera/Safari users will go elsewhere - I went to a different anti-virus vendor because I couldn't renew in Firefox and their response was to "just use IE".
2) They will go around your restrictions - I showed my mother the keyboard shortcuts to print a page for a site that didn't want you printing things. She wanted to print her receipt for a transaction - a perfectly valid thing to do!


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29274
    
140

That post was longer than I expected. My main point was to share the business reason you don't want people saving/printing the images. This is the real problem you want to solve and might have a technical answer.
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
Originally posted by Jeanne Boyarsky:
That post was longer than I expected. My main point was to share the business reason you don't want people saving/printing the images. This is the real problem you want to solve and might have a technical answer.


Actually I am working for an international wedding card designer company who are working hard around the year and producing 200 wedding cards that costs approximately one 0.5 million dollars but when we are putting our cards on the website the cheaters copying these designs and start selling just for nothing and we got nothing except loss

and if we are not publicizing these cards then how the peoples will know about the new cards

In this scenario what you recommend?

Thanks & best regards
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29274
    
140

Farakh,
Knowing the business driver helps. Most importantly, no technological measure can prevent people from using your design. If someone can see it, they can copy the ideas on paper let alone downloading a digital copy.

How about a business driven solution: show one or two designs as leads, ask people to contact you for details, etc.

Another idea is to see what your competitors do to protect their intellectual property. A quick search showed the first wedding card site I found that shows samples in both Flash and image format.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60071
    
  65

One tactic you might use is to emboss the images with a copyright notice that still gives the viewer an idea of what the image is like, but makes it difficult for even someone well-versed with Photoshop to eradicate.



[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60071
    
  65

P.S. As Jeanne pointed out, telling us why you wanted to do this would have been a good idea right off the bat.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29274
    
140

Bear,
That looks cool! It doesn't distract from the image, but looks very difficult to edit out.
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
Originally posted by Jeanne Boyarsky:
Bear,
That looks cool! It doesn't distract from the image, but looks very difficult to edit out.


Thanks for your strong and useful discussion

I also now realize that there is no solution to protect any image on the website but we have very good solution of watermark that protect to maximum possible extend

Thanks again to all
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Detecting browser
 
Similar Threads
browser hangs unless options changed
Java Plug-in
browser type
JRE enabling in the browser
by using javascript rows are hiding in mozilla but it is working IE