Ticket #755 (closed feature: fixed)

Opened 6 years ago

Last modified 6 years ago

Better Browser Detection

Reported by: euzuro Owned by:
Priority: major Milestone: 2.5 Release
Component: general Version: 2.4
Keywords: Cc:
State:

Description

For ages now we've been using OpenLayers.Util.alphaHack() to detect if we are in IE or not. With the advent of IE7, this is obviously no longer a viable solution.

Attachments

browserdetection.patch Download (1.2 KB) - added by euzuro 6 years ago.
using the navigator.userAgent string, we make a generic function to return the name of the browser in a 2-letter code (as explained in the comment)
browserdetection.2.patch Download (3.1 KB) - added by euzuro 6 years ago.
even better -- modified example.html to display the browser name in the header or "detection error" if it didnt work
browserdetection.3.patch Download (3.1 KB) - added by euzuro 6 years ago.
instead of returning null on no detection, now return "" (empty string)
browserDetection.4.patch Download (3.2 KB) - added by crschmidt 6 years ago.
change strings

Change History

Changed 6 years ago by euzuro

using the navigator.userAgent string, we make a generic function to return the name of the browser in a 2-letter code (as explained in the comment)

Changed 6 years ago by euzuro

even better -- modified example.html to display the browser name in the header or "detection error" if it didnt work

Changed 6 years ago by euzuro

instead of returning null on no detection, now return "" (empty string)

Changed 6 years ago by crschmidt

change strings

Changed 6 years ago by sderle

patch #4 seems best. go ahead and apply.

Changed 6 years ago by crschmidt

  • status changed from new to closed
  • resolution set to fixed

Changed 6 years ago by tschaub

doc string could use updating (no longer 2 character code)

Changed 6 years ago by euzuro

doc string has been updated with r3325

Note: See TracTickets for help on using tickets.