包详细信息

detector-js

pixu19802.4kMIT2.0.11

DetectorJS, zero-dependency platform/environment detector written in TypeScript

detector, detector-js, detection, feature-detection

自述文件

detector-js

v2.0.11

Description

DetectorJS, zero-dependency platform/environment detector written in TypeScript

Please feel free to ask for modifications, fixes or do a PR to improve Detector behaviors or add detection rules

Author

Emiliano 'Pixu' Pisu <pisuemiliano.1980@gmail.com>

Badges

NPM

NPM downloads/month GitHub stars GitHub forks GitHub issues GitHub license Build Status Coverage Status

Documentation

Check out the Latest Documentation here

Installation

This is a JS/TS module available through the npm registry.

It can be installed using either npm or yarn package managers.

npm i detector-js
yarn add detector-js

Usage

import { Detector } from 'detector-js';

const detector = new Detector();

// It's possible to specify a custom userAgent if needed
// const detector = new Detector('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15');

console.log(detector);
// {
//   engine:{
//     name:'WebKit',
//     version:'605.1.15'
//   },
//   browser:{
//     name:'Safari',
//     version:'12.0.3'
//   },
//   os:{
//     name:'macOS',
//     version:'10.14.3',
//     versionName:'Mojave'
//   },
//   cpu:{
//     platform:'MacIntel',
//     cores:1,
//     architecture:'x64',
//     vendor:'intel'
//   },
//   gpu:{
//     webGLVendor:'WebKit',
//     webGLRenderer:'WebKit WebGL',
//     vendor:'Intel Inc.',
//     model:'Intel Iris',
//     renderer:'Intel Iris OpenGL Engine'
//   },
//   platform:'desktop',
//     feature: {
//     pointerEnabled:false,
//     pixelRatio:1,
//     pointerLock:true,
//     quirksMode:false,
//     css3D:true,
//     cssTransform:true,
//     cssTransition:true,
//     deviceMotion:false,
//     deviceOrientation:false,
//     contextMenu:false,
//     classList:false,
//     placeholder:true,
//     viewportUnit:true,
//     remUnit:true,
//     canvas:true,
//     svg:true,
//     webGL:true,
//     webVR:false,
//     touch:false,
//     forceTouch:true,
//     srcset:true,
//     sizes:true,
//     pictureElement:true,
//     dialogElement:false,
//     addEventListener:true,
//     asyncScript:true,
//     battery:false,
//     cors:true,
//     deferScript:true,
//     file:true,
//     fileSystem:false,
//     fullscreen:true,
//     fullscreenKeyboard:true,
//     geolocation:true,
//     historyAPI:true,
//     littleEndian:false,
//     localStorage:true,
//     matchMedia:true,
//     querySelector:true,
//     querySelectorAll:true,
//     serviceWorker:true,
//     typedArray:true,
//     userMedia:false,
//     vibration:false,
//     worker:true,
//     audio:{
//       supported:true,
//       context:true,
//       formats:{
//         mp3:true,
//         webm:false,
//         ogg:false,
//         opus:false,
//         wav:true,
//         m4a:true
//       }
//     },
//     video:{
//       supported:true,
//       formats:{
//         mp4:true,
//         ogv:false,
//         webm:false
//       }
//     }
//   }
// }

Todo

  • refine browsers regexes
  • refine documentation
  • implement modular custom build feature
  • decide to implement or not device infos detection

Dependencies

Dev Dependencies

  • @parcel/packager-ts: DetectorJS, zero-dependency platform/environment detector written in TypeScript
  • @parcel/transformer-typescript-types: DetectorJS, zero-dependency platform/environment detector written in TypeScript
  • @types/node: TypeScript definitions for Node.js
  • lerna: Lerna is a fast, modern build system for managing and publishing multiple JavaScript/TypeScript packages from the same repository
  • parcel: Blazing fast, zero configuration web application bundler
  • pkg-2-readme: Generate a README.md from package.json contents
  • standard-version: replacement for npm version with automatic CHANGELOG generation
  • typedoc: Create api documentation for TypeScript projects.
  • typescript: TypeScript is a language for application scale JavaScript development

License

MIT

Powered By

JS.ORG Logo

更新日志

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

2.0.11 (2023-05-29)

Bug Fixes

  • software: fixed electron detection bug (7fc0ce3)

2.0.13 (2023-05-29)

Bug Fixes

  • software: fixed electron detection bug (7fc0ce3)

2.0.12 (2023-05-29)

Bug Fixes

  • software: fixed electron detection bug (7fc0ce3)

2.0.11 (2023-05-29)

Bug Fixes

  • software: fixed electron detection bug (7fc0ce3)

2.0.10 (2023-05-29)

Features

  • yarn: yarn release support (7f3a603)

Bug Fixes

  • feature: fixed getTypedArray bug (b2647a6)
  • feature: fixed getTypedArray bug) (c54c138)
  • feature: fixed pointerEvents constructor error (6a92328)

2.0.9 (2023-05-29)

Features

  • yarn: yarn release support (7f3a603)

Bug Fixes

  • feature: fixed getTypedArray bug) (3e56a61)
  • feature: fixed pointerEvents constructor error (7e78d0b)

2.0.8 (2023-05-29)

Features

  • yarn: yarn release support (7f3a603)

Bug Fixes

  • feature: fixed getTypedArray bug) (3e56a61)
  • feature: fixed pointerEvents constructor error (7e78d0b)

2.0.7 (2023-05-29)

2.0.6 (2023-05-29)

2.0.5 (2023-05-29)

2.0.4 (2023-05-29)

Features

  • yarn: yarn release support (7f3a603)

2.0.3 (2023-05-01)

Features

  • docs: improved typedoc docs generation, updated usage ex (5308768)
  • docs: replaced jsdoc with typedoc (7595bb9)
  • parcel: replaced rollup with parcel (ebe9128)
  • ts: typescript rework (4838e91)

Bug Fixes

  • build-broken: sorry for this, now should work (754f638)

2.0.2 (2023-04-24)

Features

  • docs: improved typedoc docs generation, updated usage ex (5308768)
  • docs: replaced jsdoc with typedoc (7595bb9)
  • parcel: replaced rollup with parcel (ebe9128)
  • ts: typescript rework (4838e91)

Version 1.3.2 (2021-3-10)

Bug fixes

  • updated license and package infos: 35957e6

...full changes

Version 1.3.1 (2021-3-9)

Bug fixes

    • dumped dependencies - fix Brave false positive wip: 312d2e2
    • added lock files to gitignore - fixing Brave false positive wip: 310c049

...full changes

Version 1.3.0 (2021-3-3)

New features

  • added webp and brave support: f4ac0e7

...full changes

Version 1.2.2 (2020-12-11)

Bug fixes

  • added Reflect polyfill to fix IE issues: de55e59
  • bumped dev dependencies: 2ed0df3
  • build v1.2.2: 1ff15a9

...full changes

Version 1.2.1 (2020-9-7)

Bug fixes

    • added prettierrc configuration - bumped devDependencies to latest versions - linting fixes: b0fffa2

...full changes

Version 1.2.0 (2020-2-6)

New features

    • bumped dependencies - reworked polyfills - fixed IE 9+ bug for Reflect.ownKeys: c39650e

...full changes

Version 1.1.12 (2019-11-8)

Bug fixes

...full changes

Version 1.1.11 (2019-11-8)

Bug fixes

  • removed sourcemaps from min builds: 6256341

...full changes

Version 1.1.10 (2019-11-7)

Bug fixes

...full changes

Version 1.1.9 (2019-11-7)

Bug fixes

...full changes

Version 1.1.8 (2019-11-7)

Bug fixes

...full changes

Version 1.1.7 (2019-11-7)

Bug fixes

  • implementing proper feedback ordering: ef959c5

...full changes

Version 1.1.6 (2019-11-7)

Bug fixes

...full changes

Version 1.1.5 (2019-11-7)

Bug fixes

...full changes

Version 1.1.4 (2019-11-7)

Bug fixes

...full changes

Version 1.1.3 (2019-11-7)

Bug fixes

...full changes

Version 1.1.2 (2019-8-28)

Bug fixes

...full changes

Version 1.1.1 (2019-2-4)

Bug fixes

  • fixed html css flags on IE: 8b81bd8

...full changes

Version 1.1.0 (2019-2-4)

New features

Bug fixes

...full changes

Version 1.0.9 (2019-2-4)

Bug fixes

  • fixed polyfills and added polyfill for IE getOwnPropertyDescriptors: d44f484

...full changes

Version 1.0.8 (2019-2-4)

Bug fixes

  • fix polyfills object.prototype.merge: d2cf93e

...full changes

Version 1.0.7 (2019-2-4)

Bug fixes

    • updated safe env Assert checking - fixed Electron detection bug on windows: bd2c025

...full changes

Version 1.0.6 (2019-1-31)

Bug fixes

  • separated indexes per build mode: fcf591a

...full changes

Version 1.0.5 (2019-1-31)

Bug fixes

  • builds with module check: f3815cb

...full changes

Version 1.0.4 (2019-1-31)

Bug fixes

  • disabled minified mangling: 924256d

...full changes

Version 1.0.3 (2019-1-31)

Bug fixes

  • updated electron version detection with a safe try catch: 0cf7161
  • testing uglify compression options: 75bda1b
  • implemented main (UMD), browser (IIFE) and module (CJS) builds: 37745a4
  • implemented normal and minified builds: dc57920

...full changes

Version 1.0.2 (2019-1-30)

Bug fixes

...full changes

Version 1.0.1 (2019-1-30)

Bug fixes

...full changes

Version 1.0.0 (2019-1-30)

Bug fixes

  • reworking regexes for browsers: 640185a
  • added toValues support: 2e4d851
  • preparing first release: 4805f1f
  • optimizations & regex rewriting: ac053e7
  • fix asserts flags & all browsers regex failure: 14d2dc2
  • preparing release 1.0: 5b64cde

...full changes

Version 0.2.1 (2019-1-28)

Bug fixes

...full changes

Version 0.2.0 (2019-1-28)

Breaking changes

Bug fixes

...full changes

Version 0.1.8 (2019-1-15)

Bug fixes

...full changes

Version 0.1.7 (2019-1-15)

Bug fixes

  • replaced webpack with rollup: 2425bb6

...full changes

Version 0.1.6 (2018-5-17)

Bug fixes

  • pkg-2-readme template updated: cee6fe2

...full changes

Version 0.1.5 (2018-5-17)

New features

  • added webVR detection flag bumped dependencies: 626e7e8

...full changes

Version 0.1.4 (2018-3-20)

Bug fixes

  • fixed global detector export: bb06ac3

...full changes

Version 0.1.3 (2018-3-20)

Bug fixes

...full changes

Version 0.1.2 (2018-3-20)

Bug fixes

  • remove flavor-js dependency in order to make it work with angular5 router: fe510d0

...full changes

Version 0.1.1 (2018-3-20)

Bug fixes

  • added css flags by default: 07ffc88

...full changes

Version 0.1.0 (2018-3-20)

Breaking changes

  • updated version/build stuff added html css classes feature updated dependencies: 9cc3932

...full changes

Version 0.0.11 (2018-3-8)

Bug fixes

  • v0.0.10: ce37a3f
  • bumped ssri to v5.2.4 in order to fix the security vulnerability issue: 0db5264

...full changes

Version 0.0.10 (2018-1-26)

New features

  • added battery feature detection: 3f3afb1

...full changes

Version 0.0.9 (2018-1-26)

Bug fixes

...full changes


Generated by changelog.md