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

后端 未结 4 1139
盖世英雄少女心
盖世英雄少女心 2020-11-30 03:50

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 becaus

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-30 04:11

    Based on Johnny Stenback's post:

    This was debated on the mozilla newsgroups ages ago and it was decided that navigator.appName should return 'Netscape' even in mozilla since if that were to be changed every page out on the web that uses some browser sniffing code (and that's a HUGE part of the current web) would need to recognize mozilla, and that just won't happen and there's no reason to do that either since mozilla == netscape == mozilla as far as content developers are conserned.

    Source here.

提交回复
热议问题