Js_ determine whether the browser kernel is the safari browser

/Safari/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent);

PC side only have Safari Chrome field do? Why you do not need to judge other browsers?
In fact userAgent field 360, QQ and other browsers will be with Safari field, but because they are based on secondary development of Chrome, all will carry the Chrome field.
Therefore, "matching rules: Safari has a field, and there is no Chrome field" on it.

Reference address

Guess you like

Origin www.cnblogs.com/wush-1215/p/11595890.html