mirror of
https://github.com/lancedikson/bowser
synced 2024-10-27 20:34:22 +00:00
Merge pull request #2 from mocheng/patch-1.
cache user agent detection result.
This commit is contained in:
commit
1e649921d7
@ -14,9 +14,15 @@
|
|||||||
safari = /safari/i.test(ua) && !chrome,
|
safari = /safari/i.test(ua) && !chrome,
|
||||||
opera = /opera/i.test(ua),
|
opera = /opera/i.test(ua),
|
||||||
firefox = /firefox/i.test(ua),
|
firefox = /firefox/i.test(ua),
|
||||||
gecko = /gecko\//i.test(ua);
|
gecko = /gecko\//i.test(ua),
|
||||||
|
info;
|
||||||
|
|
||||||
function bowser() {
|
function bowser() {
|
||||||
|
info = info ? info : detect();
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
function detect() {
|
||||||
|
|
||||||
if (ie) {
|
if (ie) {
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user