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.0.8 to 0.0.9

10

lib/google-u2f-api.js

@@ -128,2 +128,12 @@ // Copyright 2014 Google Inc. All rights reserved

/**
* Call MessagePort disconnect
*/
u2f.disconnect = function() {
if (u2f.port_ && u2f.port_.port_) {
u2f.port_.port_.disconnect();
u2f.port_ = null;
}
};
/**
* Sets up a MessagePort to the U2F extension using the

@@ -130,0 +140,0 @@ * available mechanisms.

27

lib/u2f-api.js

@@ -57,10 +57,18 @@ 'use strict';

} );
ret.promise.cancel = function( msg )
/**
* Reject request promise and disconnect port if 'disconnect' flag is true
* @param {string} msg
* @param {boolean} disconnect
*/
ret.promise.cancel = function( msg, disconnect )
{
ret.reject( makeError( msg, { errorCode: -1 } ) )
}
if ( disconnect )
coreApi.disconnect( );
ret.reject( makeError( msg, { errorCode: -1 } ) );
};
return ret;
}
function isSupported( )
function isSupported( ignorePreconditions /* = false */ )
{

@@ -77,2 +85,9 @@ var Promise = this;

if ( !ignorePreconditions )
{
if ( location.protocol === 'http:' )
// U2F isn't supported over http, only https
return Promise.resolve( false );
}
return defer( Promise, coreApi.isSupported ).promise;

@@ -88,3 +103,7 @@ }

if ( !value )
{
if ( location.protocol === 'http:' )
throw new Error( "U2F isn't supported over http, only https" );
throw new Error( "U2F not supported" );
}
} );

@@ -91,0 +110,0 @@ }

2

package.json

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

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

@@ -8,0 +8,0 @@ "repository": {

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