Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
140
rated 0 times [  141] [ 1]  / answers: 1 / hits: 41093  / 12 Years ago, tue, january 29, 2013, 12:00:00

Why does navigator.appName return Netscape for Safari, Firefox and Chrome?



What do they have to do with the old browser Netscape? Could it be because of DOM0?


More From » html

 Answers
67

Yes and that's for compatibility issues and not to be relied on.

MDN says: This was originally part of DOM Level 0, but has been since included in the HTML5 spec.



See Mozilla documentation here.



BTW; that's why this cannot be used for browser detection. Browser detection is a BAD practice and you should always avoid it where possible. Do feature detection instead. But if anybody insists on this; they should use the userAgent property instead.



UPDATE 1: According to Compatibility Changes; IE11 now also returns Netscape for navigator.appName property, to reflect the HTML5 standard and to match behavior of other browsers. Also see changes in userAgent string here... More on feature detection here...



UPDATE 2: Microsoft Edge also returns Netscape for navigator.appName.


[#80565] Sunday, January 27, 2013, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rocioblancac

Total Points: 699
Total Questions: 96
Total Answers: 108

Location: Libya
Member since Mon, Dec 7, 2020
4 Years ago
;