Comparing version 1.1.0 to 1.2.0
@@ -113,6 +113,16 @@ 'use strict'; | ||
// var paid_callbacks = []; | ||
function timeout(ms) { | ||
return new Promise(resolve => setTimeout(resolve, ms)); | ||
} | ||
async function fetch_user() { | ||
const storage = await get(['extensionpay_api_key', 'extensionpay_user']); | ||
var storage = await get(['extensionpay_api_key', 'extensionpay_user']); | ||
// wait 10 seconds for api key to be returned if creator is running this in background.js immediately after extpay initialization | ||
for (var i=0; i < 20; ++i) { | ||
if (storage.extensionpay_api_key) break; | ||
await timeout(500); | ||
storage = await get(['extensionpay_api_key', 'extensionpay_user']); | ||
} | ||
if (!storage.extensionpay_api_key) throw 'Error registering user.' | ||
const resp = await fetch(`${EXTENSION_URL}/api/user?api_key=${storage.extensionpay_api_key}`, { | ||
@@ -119,0 +129,0 @@ method: 'GET', |
@@ -1342,6 +1342,16 @@ var ExtPay = (function () { | ||
// var paid_callbacks = []; | ||
function timeout(ms) { | ||
return new Promise(resolve => setTimeout(resolve, ms)); | ||
} | ||
async function fetch_user() { | ||
const storage = await get(['extensionpay_api_key', 'extensionpay_user']); | ||
var storage = await get(['extensionpay_api_key', 'extensionpay_user']); | ||
// wait 10 seconds for api key to be returned if creator is running this in background.js immediately after extpay initialization | ||
for (var i=0; i < 20; ++i) { | ||
if (storage.extensionpay_api_key) break; | ||
await timeout(500); | ||
storage = await get(['extensionpay_api_key', 'extensionpay_user']); | ||
} | ||
if (!storage.extensionpay_api_key) throw 'Error registering user.' | ||
const resp = await fetch(`${EXTENSION_URL}/api/user?api_key=${storage.extensionpay_api_key}`, { | ||
@@ -1348,0 +1358,0 @@ method: 'GET', |
@@ -111,6 +111,16 @@ import { runtime, management, storage, windows } from 'webextension-polyfill'; | ||
// var paid_callbacks = []; | ||
function timeout(ms) { | ||
return new Promise(resolve => setTimeout(resolve, ms)); | ||
} | ||
async function fetch_user() { | ||
const storage = await get(['extensionpay_api_key', 'extensionpay_user']); | ||
var storage = await get(['extensionpay_api_key', 'extensionpay_user']); | ||
// wait 10 seconds for api key to be returned if creator is running this in background.js immediately after extpay initialization | ||
for (var i=0; i < 20; ++i) { | ||
if (storage.extensionpay_api_key) break; | ||
await timeout(500); | ||
storage = await get(['extensionpay_api_key', 'extensionpay_user']); | ||
} | ||
if (!storage.extensionpay_api_key) throw 'Error registering user.' | ||
const resp = await fetch(`${EXTENSION_URL}/api/user?api_key=${storage.extensionpay_api_key}`, { | ||
@@ -117,0 +127,0 @@ method: 'GET', |
@@ -126,6 +126,16 @@ // Sign up at https://extensionpay.com to use this library. AGPLv3 licensed. | ||
// var paid_callbacks = []; | ||
function timeout(ms) { | ||
return new Promise(resolve => setTimeout(resolve, ms)); | ||
} | ||
async function fetch_user() { | ||
const storage = await get(['extensionpay_api_key', 'extensionpay_user']) | ||
var storage = await get(['extensionpay_api_key', 'extensionpay_user']) | ||
// wait 10 seconds for api key to be returned if creator is running this in background.js immediately after extpay initialization | ||
for (var i=0; i < 20; ++i) { | ||
if (storage.extensionpay_api_key) break; | ||
await timeout(500) | ||
storage = await get(['extensionpay_api_key', 'extensionpay_user']) | ||
} | ||
if (!storage.extensionpay_api_key) throw 'Error registering user.' | ||
const resp = await fetch(`${EXTENSION_URL}/api/user?api_key=${storage.extensionpay_api_key}`, { | ||
@@ -132,0 +142,0 @@ method: 'GET', |
{ | ||
"name": "extpay", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "The JavaScript library for https://extensionpay.com - payments for browser extensions, no server needed.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/ExtPay.common.js", |
// this line is required in background.js to use ExtPay! | ||
var extpay = ExtPay('sample-extension'); | ||
extpay.getUser().then(user => { | ||
console.log(user) | ||
}) |
@@ -1342,6 +1342,16 @@ var ExtPay = (function () { | ||
// var paid_callbacks = []; | ||
function timeout(ms) { | ||
return new Promise(resolve => setTimeout(resolve, ms)); | ||
} | ||
async function fetch_user() { | ||
const storage = await get(['extensionpay_api_key', 'extensionpay_user']); | ||
var storage = await get(['extensionpay_api_key', 'extensionpay_user']); | ||
// wait 10 seconds for api key to be returned if creator is running this in background.js immediately after extpay initialization | ||
for (var i=0; i < 20; ++i) { | ||
if (storage.extensionpay_api_key) break; | ||
await timeout(500); | ||
storage = await get(['extensionpay_api_key', 'extensionpay_user']); | ||
} | ||
if (!storage.extensionpay_api_key) throw 'Error registering user.' | ||
const resp = await fetch(`${EXTENSION_URL}/api/user?api_key=${storage.extensionpay_api_key}`, { | ||
@@ -1348,0 +1358,0 @@ method: 'GET', |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
185827
3209
10