Skip to content
This repository has been archived by the owner on Mar 2, 2021. It is now read-only.

Commit

Permalink
add notes about what changes need to be preserved when updating
Browse files Browse the repository at this point in the history
  • Loading branch information
btoews committed Sep 12, 2018
1 parent 1857d51 commit d6190fb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion u2f-api-polyfill.js
Expand Up @@ -4,12 +4,19 @@
//license that can be found in the LICENSE file or at
//https://developers.google.com/open-source/licenses/bsd

// NOTE FROM MAINTAINER: This file is copied from google/u2f-ref-code with as
// few alterations as possible. Any changes that were necessary are annotated
// with "NECESSARY CHANGE". These changes, as well as this note, should be
// preserved when updating this file from the source.

/**
* @fileoverview The U2F api.
*/
'use strict';

// NECESSARY CHANGE: wrap the whole file in a closure
(function (){
// NECESSARY CHANGE: detect UA to avoid clobbering other browser's U2F API.
var isChrome = 'chrome' in window && window.navigator.userAgent.indexOf('Edge') < 0;
if ('u2f' in window || !isChrome) {
return;
Expand All @@ -19,7 +26,8 @@
* Namespace for the U2F api.
* @type {Object}
*/
var u2f = u2f || {};
// NECESSARY CHANGE: define the window.u2f API.
var u2f = window.u2f = {};

/**
* FIDO U2F Javascript API Version
Expand Down

0 comments on commit d6190fb

Please sign in to comment.