1
0
mirror of https://github.com/lancedikson/bowser synced 2024-10-27 20:34:22 +00:00

Avoid exception when unable to match UA

Make detect() return an empty object if it hasn't matched any known browser, so that graded browser support (and any external code using this library) doesn't raise a "Cannot read property ... of undefined" exception
This commit is contained in:
Martino di Filippo 2013-06-27 19:41:01 +02:00
parent 23545d4403
commit 601eac6897

View File

@ -90,6 +90,7 @@
seamonkey: t
, version: ua.match(/seamonkey\/(\d+(\.\d+)?)/i)[1]
}
return {}
}
var bowser = detect()