@braintree/browser-detection
Advanced tools
Comparing version 1.14.0 to 1.16.0
@@ -18,2 +18,3 @@ import isAndroid = require("./is-android"); | ||
import isIosWKWebview = require("./is-ios-wkwebview"); | ||
import isIpadOS = require("./is-ipados"); | ||
import isMobileFirefox = require("./is-mobile-firefox"); | ||
@@ -26,2 +27,2 @@ import isOpera = require("./is-opera"); | ||
import supportsPaymentRequestApi = require("./supports-payment-request-api"); | ||
export { isAndroid, isChromeOS, isChrome, isDuckDuckGo, isIe, isIe9, isIe10, isIe11, isEdge, isFirefox, isIos, isIosFirefox, isIosGoogleSearchApp, isIosSafari, isIosUIWebview, isIosWebview, isIosWKWebview, isMobileFirefox, isOpera, isSamsungBrowser, isSilk, hasSoftwareKeyboard, supportsPopups, supportsPaymentRequestApi, }; | ||
export { isAndroid, isChromeOS, isChrome, isDuckDuckGo, isIe, isIe9, isIe10, isIe11, isEdge, isFirefox, isIos, isIosFirefox, isIosGoogleSearchApp, isIosSafari, isIosUIWebview, isIosWebview, isIosWKWebview, isIpadOS, isMobileFirefox, isOpera, isSamsungBrowser, isSilk, hasSoftwareKeyboard, supportsPopups, supportsPaymentRequestApi, }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.supportsPaymentRequestApi = exports.supportsPopups = exports.hasSoftwareKeyboard = exports.isSilk = exports.isSamsungBrowser = exports.isOpera = exports.isMobileFirefox = exports.isIosWKWebview = exports.isIosWebview = exports.isIosUIWebview = exports.isIosSafari = exports.isIosGoogleSearchApp = exports.isIosFirefox = exports.isIos = exports.isFirefox = exports.isEdge = exports.isIe11 = exports.isIe10 = exports.isIe9 = exports.isIe = exports.isDuckDuckGo = exports.isChrome = exports.isChromeOS = exports.isAndroid = void 0; | ||
exports.supportsPaymentRequestApi = exports.supportsPopups = exports.hasSoftwareKeyboard = exports.isSilk = exports.isSamsungBrowser = exports.isOpera = exports.isMobileFirefox = exports.isIpadOS = exports.isIosWKWebview = exports.isIosWebview = exports.isIosUIWebview = exports.isIosSafari = exports.isIosGoogleSearchApp = exports.isIosFirefox = exports.isIos = exports.isFirefox = exports.isEdge = exports.isIe11 = exports.isIe10 = exports.isIe9 = exports.isIe = exports.isDuckDuckGo = exports.isChrome = exports.isChromeOS = exports.isAndroid = void 0; | ||
var isAndroid = require("./is-android"); | ||
@@ -38,2 +38,4 @@ exports.isAndroid = isAndroid; | ||
exports.isIosWKWebview = isIosWKWebview; | ||
var isIpadOS = require("./is-ipados"); | ||
exports.isIpadOS = isIpadOS; | ||
var isMobileFirefox = require("./is-mobile-firefox"); | ||
@@ -40,0 +42,0 @@ exports.isMobileFirefox = isMobileFirefox; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined, statusBarVisible?: boolean | undefined) => boolean; | ||
declare const _default: (ua?: string, statusBarVisible?: boolean) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined, statusBarVisible?: boolean | undefined) => boolean; | ||
declare const _default: (ua?: string, statusBarVisible?: boolean) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string, checkIpadOS?: boolean, document?: object) => boolean; | ||
export = _default; |
"use strict"; | ||
module.exports = function isIos(ua) { | ||
var isIpadOS = require("./is-ipados"); | ||
module.exports = function isIos(ua, checkIpadOS, document) { | ||
if (checkIpadOS === void 0) { checkIpadOS = true; } | ||
ua = ua || window.navigator.userAgent; | ||
return /iPhone|iPod|iPad/i.test(ua); | ||
var iOsTest = /iPhone|iPod|iPad/i.test(ua); | ||
return checkIpadOS ? iOsTest || isIpadOS(ua, document) : iOsTest; | ||
}; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
@@ -1,2 +0,2 @@ | ||
declare const _default: (ua?: string | undefined) => boolean; | ||
declare const _default: (ua?: string) => boolean; | ||
export = _default; |
{ | ||
"name": "@braintree/browser-detection", | ||
"version": "1.14.0", | ||
"version": "1.16.0", | ||
"description": "A small lib to detect browser compatibility for braintree products", | ||
@@ -12,12 +12,13 @@ "main": "dist/browser-detection.js", | ||
"devDependencies": { | ||
"@types/jest": "^27.4.1", | ||
"@types/node": "^17.0.23", | ||
"@typescript-eslint/eslint-plugin": "^5.19.0", | ||
"eslint": "^8.13.0", | ||
"@types/jest": "^29.4.0", | ||
"@types/node": "^18.14.6", | ||
"@typescript-eslint/eslint-plugin": "^5.54.1", | ||
"eslint": "^8.35.0", | ||
"eslint-config-braintree": "^6.0.0-typescript-prep-rc.2", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"jest": "^27.5.1", | ||
"prettier": "^2.6.2", | ||
"ts-jest": "^27.1.4", | ||
"typescript": "^4.6.3" | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"jest": "^29.5.0", | ||
"jest-environment-jsdom": "^29.5.0", | ||
"prettier": "^2.8.4", | ||
"ts-jest": "^29.0.5", | ||
"typescript": "^4.9.5" | ||
}, | ||
@@ -24,0 +25,0 @@ "scripts": { |
@@ -27,2 +27,3 @@ # Browser Detection | ||
browserDetection.isIosWKWebview(); | ||
browserDetection.isIpadOS(); | ||
browserDetection.isMobileFirefox(); | ||
@@ -57,2 +58,3 @@ browserDetection.isOpera(); | ||
const isIosWKWebview = require("browser-detection/is-ios-wkwebview"); | ||
const isIpadOS = require("browser-detection/is-ipados"); | ||
const isMobileFirefox = require("browser-detection/is-mobile-firefox"); | ||
@@ -72,1 +74,15 @@ const isOpera = require("browser-detection/is-opera"); | ||
``` | ||
### Notes on isIpadOs | ||
`isIpadOS` is a new option for browser detection, and is also included in isIos. isIos defaults to checking for iPads to maintain consistent behavior with how it acted in the past. If `checkIpadOS` is set to false, then it will only check for older gen iPads and current iOS | ||
```js | ||
const browserDetection = require("browser-detection"); | ||
const ua = window.navigator.userAgent; | ||
// assume ua is from iPadOs 13 "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Safari/605.1.15" | ||
browserDetection.isIos(ua); | ||
// will return true | ||
browserDetection.isIos(ua, false); | ||
// will return false | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23639
83
414
86
11