Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@realeyes/environment-checker
Advanced tools
This package allows you to automatically run the environment check and receive the return the result in a simplified format. We provide three versions of Environment Checker, version 1 should be used for flash-only collections, version 2 for flash and WebRTC collections, version 3 for WebRTC only.
The general format for the script URL is "https://codesdwncdn.realeyesit.com/environment-checker/release/{version}/Realeyesit.EnvironmentalDetectionAPI.min.js"
. You can specify which kinds of updates your app can accept using semver string in a following format:
x.y
to receive only bug fixes: https://codesdwncdn.realeyesit.com/environment-checker/release/3.1/Realeyesit.EnvironmentalDetectionAPI.min.js
x
to receive bug fixes and new features (recommended): https://codesdwncdn.realeyesit.com/environment-checker/release/3/Realeyesit.EnvironmentalDetectionAPI.min.js
This example loads the latest release of version 3:
<script src="https://codesdwncdn.realeyesit.com/environment-checker/release/3/Realeyesit.EnvironmentalDetectionAPI.min.js"></script>
To use the self-hosted solution you will have to download the archive that contains all necessary files and deploy it on your host https://codesdwncdn.realeyesit.com/environment-checker/release/3/environment-checker.zip. You will also have to change the SWF path in the javascript source code. Find the DEFAULT_FLASH_DETECTOR_PATH variable and replace its value, for example DEFAULT_FLASH_DETECTOR_PATH = 'https://example.com/environment-detector.swf';
To use environment checker you can register a callback function _RealeyesitEnvDetectCallback
or _RealeyesitEnvDetectParams._callback
.
The other way is to call the Realeyesit.EnvironmentalDetectionAPI.start(callback, options)
method manually. In this case you should provide the callback that will handle the result.
options
parameter is optional and can be used to disable logging, for example: Realeyesit.EnvironmentalDetectionAPI.start(callback, { logger: { disable: true } })
. In options we can manage the allowed device types also for example: Realeyesit.EnvironmentalDetectionAPI.start(callback, { logger: { disable: true }, allowedDevices: [ 'mobile', 'tablet', 'desktop' ] })
The result will be in the following format:
{
checksPassed: boolean,
failureReasonCode: number,
failureReasonString: string,
detectorResult: {
browser: {
name: string,
version: string,
},
platform: {
type: string,
},
os: {
name: string,
version: string,
},
flash: ({
version: string,
}|null),
webcams: Array.<string>,
capabilities: Array.<string>
},
}
Where 'failureReasonCode' is one of:
BROWSER_NOT_CAPABLE: 4
MOBILE_BROWSER: 5
NO_WEBCAMS_DETECTED: 6
OTHER_ERROR: 7
IOS_WEBVIEW: 8
UNSUPPORTED_BROWSER: 9
TABLET_BROWSER: 10
DESKTOP_BROWSER: 11
And 'detectorResult' is a result object of environment detector (see more Environment Detector API)
NOTE: if you are using Environment Checker, then there is no need to use Environment Detector separately.
<script type="text/javascript">
function environmentalDetectionCallback(result) {
alert(result.checksPassed ? 'Passed ' : 'Failed. ' + result.failureReasonString);
}
var _RealeyesitEnvDetectParams = _RealeyesitEnvDetectParams || {};
_RealeyesitEnvDetectParams._callback = environmentalDetectionCallback;
(function() {
var envDetect = document.createElement('script');
envDetect.type = 'text/javascript';
envDetect.async = true;
envDetect.src = 'https://codesdwncdn.realeyesit.com/environment-checker/release/3/Realeyesit.EnvironmentalDetectionAPI.min.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(envDetect, s);
})();
</script>
Copyright 2018 Realeyes OU.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
FAQs
Environment Checker
The npm package @realeyes/environment-checker receives a total of 22 weekly downloads. As such, @realeyes/environment-checker popularity was classified as not popular.
We found that @realeyes/environment-checker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.