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

extpay

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extpay - npm Package Compare versions

Comparing version 4.0.0-beta.3 to 4.0.0-beta.5

.package.json.swo

63

dist/ExtPay.common.js

@@ -5,2 +5,22 @@ 'use strict';

function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n["default"] = e;
return Object.freeze(n);
}
var browser__namespace = /*#__PURE__*/_interopNamespace(browser);
// Sign up at https://extensionpay.com to use this library. AGPLv3 licensed.

@@ -16,3 +36,4 @@

if (event.data === 'fetch-user' || event.data === 'trial-start') {
browser.runtime.sendMessage(event.data);
window.postMessage(`${event.data}-received`);
browser__namespace.runtime.sendMessage(event.data);
}

@@ -32,6 +53,6 @@ }, false);

try {
return await browser.storage.sync.get(key)
return await browser__namespace.storage.sync.get(key)
} catch(e) {
// if sync not available (like with Firefox temp addons), fall back to local
return await browser.storage.local.get(key)
return await browser__namespace.storage.local.get(key)
}

@@ -41,6 +62,6 @@ }

try {
return await browser.storage.sync.set(dict)
return await browser__namespace.storage.sync.set(dict)
} catch(e) {
// if sync not available (like with Firefox temp addons), fall back to local
return await browser.storage.local.set(dict)
return await browser__namespace.storage.local.set(dict)
}

@@ -50,3 +71,3 @@ }

// ----- start configuration checks
browser.management && browser.management.getSelf().then(async (ext_info) => {
browser__namespace.management && browser__namespace.management.getSelf().then(async (ext_info) => {
if (!ext_info.permissions.includes('storage')) {

@@ -85,9 +106,9 @@ var permissions = ext_info.hostPermissions.concat(ext_info.permissions);

var ext_info;
if (browser.management) {
ext_info = await browser.management.getSelf();
} else if (browser.runtime) {
ext_info = await browser.runtime.sendMessage('extpay-extinfo'); // ask background page for ext info
if (browser__namespace.management) {
ext_info = await browser__namespace.management.getSelf();
} else if (browser__namespace.runtime) {
ext_info = await browser__namespace.runtime.sendMessage('extpay-extinfo'); // ask background page for ext info
if (!ext_info) {
// Safari doesn't support browser.management for some reason
const is_dev_mode = !('update_url' in browser.runtime.getManifest());
const is_dev_mode = !('update_url' in browser__namespace.runtime.getManifest());
ext_info = {installType: is_dev_mode ? 'development' : 'normal'};

@@ -193,4 +214,4 @@ }

async function open_popup(url, width, height) {
if (browser.windows && browser.windows.create) {
const current_window = await browser.windows.getCurrent();
if (browser__namespace.windows && browser__namespace.windows.create) {
const current_window = await browser__namespace.windows.getCurrent();
// https://stackoverflow.com/a/68456858

@@ -200,3 +221,3 @@ const left = Math.round((current_window.width - width) * 0.5 + current_window.left);

try {
browser.windows.create({
browser__namespace.windows.create({
url: url,

@@ -212,3 +233,3 @@ type: "popup",

// firefox doesn't support 'focused'
browser.windows.create({
browser__namespace.windows.create({
url: url,

@@ -238,4 +259,4 @@ type: "popup",

}
if (browser.tabs && browser.tabs.create) {
await browser.tabs.create({url, active: true});
if (browser__namespace.tabs && browser__namespace.tabs.create) {
await browser__namespace.tabs.create({url, active: true});
} else {

@@ -302,3 +323,3 @@ window.open(url, '_blank');

}]`;
const manifest = browser.runtime.getManifest();
const manifest = browser__namespace.runtime.getManifest();
if (!manifest.content_scripts) {

@@ -341,3 +362,3 @@ throw `ExtPay setup error: To use the onPaid callback handler, please include ExtPay as a content script in your manifest.json. You can copy the example below into your manifest.json or check the docs: https://github.com/Glench/ExtPay#2-configure-your-manifestjson

startBackground: function() {
browser.runtime.onMessage.addListener(function(message, sender, send_response) {
browser__namespace.runtime.onMessage.addListener(function(message, sender, send_response) {
console.log('service worker got message! Here it is:', message);

@@ -351,5 +372,5 @@ if (message == 'fetch-user') {

fetch_user();
} else if (message == 'extpay-extinfo' && browser.management) {
} else if (message == 'extpay-extinfo' && browser__namespace.management) {
// get this message from content scripts which can't access browser.management
return browser.management.getSelf()
return browser__namespace.management.getSelf()
}

@@ -356,0 +377,0 @@ });

@@ -1244,2 +1244,3 @@ var ExtPay = (function () {

if (event.data === 'fetch-user' || event.data === 'trial-start') {
window.postMessage(`${event.data}-received`);
browserPolyfill.runtime.sendMessage(event.data);

@@ -1580,2 +1581,2 @@ }

}());
})();

@@ -1,2 +0,2 @@

import { management, runtime, storage, tabs, windows } from 'webextension-polyfill';
import * as browser from 'webextension-polyfill';

@@ -13,3 +13,4 @@ // Sign up at https://extensionpay.com to use this library. AGPLv3 licensed.

if (event.data === 'fetch-user' || event.data === 'trial-start') {
runtime.sendMessage(event.data);
window.postMessage(`${event.data}-received`);
browser.runtime.sendMessage(event.data);
}

@@ -29,6 +30,6 @@ }, false);

try {
return await storage.sync.get(key)
return await browser.storage.sync.get(key)
} catch(e) {
// if sync not available (like with Firefox temp addons), fall back to local
return await storage.local.get(key)
return await browser.storage.local.get(key)
}

@@ -38,6 +39,6 @@ }

try {
return await storage.sync.set(dict)
return await browser.storage.sync.set(dict)
} catch(e) {
// if sync not available (like with Firefox temp addons), fall back to local
return await storage.local.set(dict)
return await browser.storage.local.set(dict)
}

@@ -47,3 +48,3 @@ }

// ----- start configuration checks
management && management.getSelf().then(async (ext_info) => {
browser.management && browser.management.getSelf().then(async (ext_info) => {
if (!ext_info.permissions.includes('storage')) {

@@ -82,9 +83,9 @@ var permissions = ext_info.hostPermissions.concat(ext_info.permissions);

var ext_info;
if (management) {
ext_info = await management.getSelf();
} else if (runtime) {
ext_info = await runtime.sendMessage('extpay-extinfo'); // ask background page for ext info
if (browser.management) {
ext_info = await browser.management.getSelf();
} else if (browser.runtime) {
ext_info = await browser.runtime.sendMessage('extpay-extinfo'); // ask background page for ext info
if (!ext_info) {
// Safari doesn't support browser.management for some reason
const is_dev_mode = !('update_url' in runtime.getManifest());
const is_dev_mode = !('update_url' in browser.runtime.getManifest());
ext_info = {installType: is_dev_mode ? 'development' : 'normal'};

@@ -190,4 +191,4 @@ }

async function open_popup(url, width, height) {
if (windows && windows.create) {
const current_window = await windows.getCurrent();
if (browser.windows && browser.windows.create) {
const current_window = await browser.windows.getCurrent();
// https://stackoverflow.com/a/68456858

@@ -197,3 +198,3 @@ const left = Math.round((current_window.width - width) * 0.5 + current_window.left);

try {
windows.create({
browser.windows.create({
url: url,

@@ -209,3 +210,3 @@ type: "popup",

// firefox doesn't support 'focused'
windows.create({
browser.windows.create({
url: url,

@@ -235,4 +236,4 @@ type: "popup",

}
if (tabs && tabs.create) {
await tabs.create({url, active: true});
if (browser.tabs && browser.tabs.create) {
await browser.tabs.create({url, active: true});
} else {

@@ -299,3 +300,3 @@ window.open(url, '_blank');

}]`;
const manifest = runtime.getManifest();
const manifest = browser.runtime.getManifest();
if (!manifest.content_scripts) {

@@ -338,3 +339,3 @@ throw `ExtPay setup error: To use the onPaid callback handler, please include ExtPay as a content script in your manifest.json. You can copy the example below into your manifest.json or check the docs: https://github.com/Glench/ExtPay#2-configure-your-manifestjson

startBackground: function() {
runtime.onMessage.addListener(function(message, sender, send_response) {
browser.runtime.onMessage.addListener(function(message, sender, send_response) {
console.log('service worker got message! Here it is:', message);

@@ -348,5 +349,5 @@ if (message == 'fetch-user') {

fetch_user();
} else if (message == 'extpay-extinfo' && management) {
} else if (message == 'extpay-extinfo' && browser.management) {
// get this message from content scripts which can't access browser.management
return management.getSelf()
return browser.management.getSelf()
}

@@ -358,2 +359,2 @@ });

export default ExtPay;
export { ExtPay as default };

@@ -15,2 +15,3 @@ // Sign up at https://extensionpay.com to use this library. AGPLv3 licensed.

if (event.data === 'fetch-user' || event.data === 'trial-start') {
window.postMessage(`${event.data}-received`)
browser.runtime.sendMessage(event.data)

@@ -17,0 +18,0 @@ }

{
"name": "extpay",
"version": "4.0.0-beta.3",
"version": "4.0.0-beta.5",
"description": "The JavaScript library for https://extensionpay.com - payments for browser extensions, no server needed.",

@@ -5,0 +5,0 @@ "main": "./dist/ExtPay.common.js",

@@ -43,3 +43,3 @@ # THIS IS A BETA RELEASE, PLEASE DO NOT USE UNLESS YOU'VE BEEN EXPLICITLY ASKED TO

```bash
npm install extpay --save
npm install extpay@beta --save
```

@@ -46,0 +46,0 @@

@@ -1244,2 +1244,3 @@ var ExtPay = (function () {

if (event.data === 'fetch-user' || event.data === 'trial-start') {
window.postMessage(`${event.data}-received`);
browserPolyfill.runtime.sendMessage(event.data);

@@ -1580,2 +1581,2 @@ }

}());
})();

@@ -1244,2 +1244,3 @@ var ExtPay = (function () {

if (event.data === 'fetch-user' || event.data === 'trial-start') {
window.postMessage(`${event.data}-received`);
browserPolyfill.runtime.sendMessage(event.data);

@@ -1580,2 +1581,2 @@ }

}());
})();

@@ -1244,2 +1244,3 @@ var ExtPay = (function () {

if (event.data === 'fetch-user' || event.data === 'trial-start') {
window.postMessage(`${event.data}-received`);
browserPolyfill.runtime.sendMessage(event.data);

@@ -1580,2 +1581,2 @@ }

}());
})();
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