UNPKG
is-ua-webview
Version:
latest (1.1.2)
1.1.2
1.1.1
1.1.0
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
useragent parsing for webview detection
github.com/atomantic/is-ua-webview
atomantic/is-ua-webview
is-ua-webview
/
index.js
7 lines
(5 loc)
•
182 B
JavaScript
View Raw
1
2
3
4
5
6
7
var
rules =
require
(
'./data/rules'
)
var
webviewRegExp =
new
RegExp
(
'('
+ rules.
join
(
'|'
) +
')'
,
'ig'
)
module
.
exports
=
function
isWebview
(
ua
) {
return
!!ua.
match
(webviewRegExp) }