Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

u2f-api

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

u2f-api - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

16

index.d.ts
export declare type CancellablePromise<T> = Promise<T> & {
cancel: () => void;
cancel(): void;
};
export declare type RegisterRequest = any;
export declare type SignRequest = any;
export declare type RegisterResponse = any;
export declare type SignResponse = any;
export declare type NotYetTyped = { [ key: string ]: any; };
export declare type RegisterRequest = NotYetTyped;
export declare type SignRequest = NotYetTyped;
export declare type RegisterResponse = NotYetTyped;
export declare type SignResponse = NotYetTyped;
export declare enum ErrorCodesEnum {

@@ -33,3 +34,4 @@ CANCELLED = -1,

}
export declare type Exporter = ((promiseImplementation: PromiseConstructorLike) => API) & API;
export default Exporter;
export declare type ExporterType = ((promiseImplementation: PromiseConstructorLike) => API) & API;
declare const _default: ExporterType;
export default _default;

@@ -7,2 +7,7 @@ 'use strict';

// Feature detection (yes really)
var isSafari = navigator.userAgent.match( /Safari\// )
&& !navigator.userAgent.match( /Chrome\// );
var isEDGE = navigator.userAgent.match( /Edge\/12/ );
var _backend = null;

@@ -14,9 +19,2 @@ function getBackend( Promise )

{
var hasNativeSupport =
( typeof window.u2f !== 'undefined' ) &&
( typeof window.u2f.sign === 'function' );
if ( hasNativeSupport )
resolve( { u2f: window.u2f, native: true } );
function notSupported( )

@@ -28,10 +26,18 @@ {

var isSafari = navigator.userAgent.match( /Safari\// )
&& !navigator.userAgent.match( /Chrome\// );
if ( isSafari )
// Safari doesn't support U2F, and the Safari-FIDO-U2F
// extension lacks full support (Multi-factet apps), so we
// block it until proper support.
return notSupported( );
var isEDGE = navigator.userAgent.match( /Edge\/12/ );
var hasNativeSupport =
( typeof window.u2f !== 'undefined' ) &&
( typeof window.u2f.sign === 'function' );
if ( isSafari || isEDGE )
// We don't want to check for Google's extension hack on these
// platforms, as they will cause trouble (popups, etc)
if ( hasNativeSupport )
resolve( { u2f: window.u2f, native: true } );
if ( isEDGE )
// We don't want to check for Google's extension hack on EDGE
// as it'll cause trouble (popups, etc)
return notSupported( );

@@ -38,0 +44,0 @@

@@ -5,3 +5,3 @@ {

"license": "MIT",
"version": "0.2.1",
"version": "0.2.2",
"author": "Gustaf Räntilä <g.rantila@gmail.com>",

@@ -21,3 +21,4 @@ "repository": {

"promise"
]
],
"types": "./index.d.ts"
}
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