@realeyes/environment-checker
Advanced tools
Comparing version 2.3.2 to 2.5.3
25
index.js
@@ -122,2 +122,3 @@ /*! | ||
OTHER_ERROR: 7, | ||
IOS_WEBVIEW: 8, | ||
}, | ||
@@ -129,2 +130,3 @@ | ||
* @param {function({EnvironmentCheckResult})} callback Callback function | ||
* @param {*} options detection options | ||
* @param {*} flash Flash detection options | ||
@@ -134,3 +136,3 @@ * @param {*} logger Logging options | ||
*/ | ||
start(callback, { | ||
start(callback, options = {}, { | ||
flash = { path: DEFAULT_FLASH_DETECTOR_PATH }, | ||
@@ -153,4 +155,7 @@ logger = {}, | ||
compareVersions(getFirstMatch(ua, /(?:chrome)\/(\d+(\.\d+)?)/i), '38') >= 0) || | ||
(/edge/i.test(ua) && compareVersions(getFirstMatch(ua, /(?:edge)\/(\d+(\.\d+)?)/i), '15') >= 0) || | ||
(/opera|opr|opios/i.test(navigator.userAgent) && | ||
compareVersions(getFirstMatch(ua, /(?:opera|opr|opios)[\s/](\d+(\.\d+)?)/i), '38') >= 0) | ||
compareVersions(getFirstMatch(ua, /(?:opera|opr|opios)[\s/](\d+(\.\d+)?)/i), '38') >= 0) || | ||
(/safari/i.test(navigator.userAgent) && | ||
compareVersions(getFirstMatch(ua, /(?:Version)[\s/](\d+(\.\d+)?)/i), '11') >= 0) | ||
) { | ||
@@ -176,5 +181,11 @@ skip.push('flash'); | ||
this.checkResults.failureReasonString = 'BROWSER_NOT_CAPABLE'; | ||
} else if (result.platform.type === platform.types.MOBILE) { | ||
} else if (result.browser.name === browsers.names.WEBVIEW) { | ||
this.checkResults.failureReasonCode = this.failureReasonCodes.WEBVIEW; | ||
this.checkResults.failureReasonString = 'IOS_WEBVIEW'; | ||
} else if (result.platform.type === platform.types.MOBILE && !options.isMobile) { | ||
this.checkResults.failureReasonCode = this.failureReasonCodes.MOBILE_BROWSER; | ||
this.checkResults.failureReasonString = 'MOBILE_BROWSER'; | ||
} else if (result.platform.type === platform.types.TABLET && !options.isTablet) { | ||
this.checkResults.failureReasonCode = this.failureReasonCodes.MOBILE_BROWSER; | ||
this.checkResults.failureReasonString = 'MOBILE_BROWSER'; | ||
} else if (result.flash === null) { | ||
@@ -273,6 +284,10 @@ this.checkResults.failureReasonCode = this.failureReasonCodes.FLASH_NOT_INSTALLED; | ||
typeof window._RealeyesitEnvDetectParams._callback === 'function') { | ||
window.Realeyesit.EnvironmentalDetectionAPI.start(window._RealeyesitEnvDetectParams._callback); | ||
window.Realeyesit.EnvironmentalDetectionAPI.start( | ||
window._RealeyesitEnvDetectParams._callback, | ||
window._RealeyesitEnvDetectParams._options); | ||
} else { | ||
if (typeof window._RealeyesitEnvDetectCallback === 'function') { | ||
window.Realeyesit.EnvironmentalDetectionAPI.start(window._RealeyesitEnvDetectCallback); | ||
window.Realeyesit.EnvironmentalDetectionAPI.start( | ||
window._RealeyesitEnvDetectCallback, | ||
(window._RealeyesitEnvDetectParams || {})._options); | ||
} | ||
@@ -279,0 +294,0 @@ } |
{ | ||
"name": "@realeyes/environment-checker", | ||
"version": "2.3.2", | ||
"version": "2.5.3", | ||
"scripts": { | ||
@@ -11,4 +11,3 @@ "lint": "eslint .", | ||
"cleanup": "rimraf dist/*", | ||
"all": "npm run cleanup && npm run lint && npm run build && npm run copy && npm run copy:example && npm run minify", | ||
"prepublish": "npm run all" | ||
"all": "npm run cleanup && npm run lint && npm run build && npm run copy && npm run copy:example && npm run minify" | ||
}, | ||
@@ -56,3 +55,3 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@realeyes/environment-detector": "^1.8.3", | ||
"@realeyes/environment-detector": "^1.8.8", | ||
"swfobject": "github:realeyes/swfobject#e057ecd34207ad7e2180d83f4a7e75aebac0e42e", | ||
@@ -59,0 +58,0 @@ "uuid": "^3.0.1" |
# Environment Checker | ||
This package allows you to automatically run the environment check and receive the return the result in a simplified format. We provide two versions of Environment Checker, version 1 should be used for flash-only collections, version 2 for flash and WebRTC collections. | ||
This package allows you to automatically run the environment check and receive the return the result in a simplified format. We provide two versions of Environment Checker, version 1 should be used for flash-only collections, version 2 for flash and WebRTC collections. | ||
@@ -69,2 +69,4 @@ ## Installation | ||
And 'detectorResult' is a result object of environment detector (see more [Environment Detector API](README.html#api)) | ||
*NOTE:* if you are using Environment Checker, then there is no need to use Environment Detector separately. | ||
@@ -71,0 +73,0 @@ ## Example usage |
# Release process | ||
* Use gitflow release or hotfix branch to prepare a release. | ||
* First commit in a release or hotfix branch should bump the version in package.json. | ||
* First commit in a release or hotfix branch should bump the version in package.json. `npm version z.y.z` | ||
* Use `followTags = true` when pushing a release. | ||
* `npm publish` from master branch after a release. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
703268
26
4101
107