New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@realeyes/environment-detector

Package Overview
Dependencies
Maintainers
2
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@realeyes/environment-detector

Environment Detector

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-33.33%
Maintainers
2
Weekly downloads
 
Created
Source

Environment Detector

Realeyesit.EnvironmentDetector API

Realeyesit.EnvironmentDetector namespace exposes one method detect(). This method returns a Promise object that resolves with EnvironmentDetectionResult object. This is the type definition for the EnvironmentDetectionResult:

/**
 * @typedef {{
 *   browser: {
 *     name: string,
 *     version: string,
 *   },
 *   platform: {
 *     type: string,
 *   },
 *   os: {
 *     name: string,
 *     version: string,
 *   },
 *   flash: ?{
 *     version: string,
 *   },
 *   webcams: Array.<string>,
 *   capabilities: Array.<string>,
 * }} EnvironmentDetectionResult
 */
  • browser.name is a string like "Chrome" or "Firefox"
  • browser.version is a version string like "53.0"
  • platform.type is one of "tablet", "mobile" or "desktop"
  • os.name is a string like "windows" or "macos"
  • os.version is a version string like "10.11"
  • flash.version is a version string "<major>.<minor>.<patch>.<build>" format
  • webcams is an array of strings, for example ["USB Camera", "iSight"]
  • capabilities is an array of strings

Here is the list of capabilities we can detect:

{
    FLASH: 'flash',
    GET_USER_MEDIA: 'navigator.getUserMedia',
    MEDIA_RECORDER: 'MediaRecorder',
    WEBCAM: 'webcam',
    DOCUMENT_ALL: 'document.all',
    DOCUMENT_QUERY_SELECTOR: 'document.querySelector',
    HTTP: 'http',
    HTTPS: 'https',
}

detect() can receive an optional options object with the following type definition:

/**
 * @typedef {{
 *   flash: {
 *     path: string,
 *     testTimeout: number,
 *     containerId: string,
 *     minFlashVersion: string,
 *   }
 * }} EnvironmentDetectionOptions
 */

Example usage

Realeyesit.EnvironmentDetector.detect()
    .then(function (result) {
        // result will be an EnvironmentDetectionResult object
    });

License

Copyright 2016 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.

Keywords

FAQs

Package last updated on 11 Oct 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc