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

@parcel/packager-webextension

Package Overview
Dependencies
Maintainers
1
Versions
441
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/packager-webextension - npm Package Compare versions

Comparing version 2.8.4-nightly.2926 to 2.8.4-nightly.2937

31

lib/WebExtensionPackager.js

@@ -7,45 +7,31 @@ "use strict";

exports.default = void 0;
function _assert() {
const data = _interopRequireDefault(require("assert"));
_assert = function () {
return data;
};
return data;
}
function _nullthrows() {
const data = _interopRequireDefault(require("nullthrows"));
_nullthrows = function () {
return data;
};
return data;
}
function _plugin() {
const data = require("@parcel/plugin");
_plugin = function () {
return data;
};
return data;
}
function _utils() {
const data = require("@parcel/utils");
_utils = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = new (_plugin().Packager)({

@@ -58,3 +44,2 @@ async package({

var _manifest$background;
let assets = [];

@@ -67,9 +52,6 @@ bundle.traverseAssets(asset => {

const asset = manifestAssets[0];
const relPath = b => (0, _utils().relativeBundlePath)(bundle, b, {
leadingDotSlash: false
});
const manifest = JSON.parse(await asset.getCode());
if (((_manifest$background = manifest.background) === null || _manifest$background === void 0 ? void 0 : _manifest$background.type) === 'module') {

@@ -80,10 +62,7 @@ // service workers are built with output format 'global'

}
const deps = asset.getDependencies();
const war = [];
for (const contentScript of manifest.content_scripts || []) {
const srcBundles = deps.filter(d => {
var _contentScript$js, _contentScript$css;
return ((_contentScript$js = contentScript.js) === null || _contentScript$js === void 0 ? void 0 : _contentScript$js.includes(d.id)) || ((_contentScript$css = contentScript.css) === null || _contentScript$css === void 0 ? void 0 : _contentScript$css.includes(d.id));

@@ -102,3 +81,2 @@ }).map(d => (0, _nullthrows().default)(bundleGraph.getReferencedBundle(d, bundle)));

}).map(relPath);
if (resources.length > 0) {

@@ -108,8 +86,7 @@ war.push({

if (/^(((http|ws)s?)|ftp|\*):\/\//.test(match)) {
let pathIndex = match.indexOf('/', match.indexOf('://') + 3); // Avoids creating additional errors in invalid match URLs
let pathIndex = match.indexOf('/', match.indexOf('://') + 3);
// Avoids creating additional errors in invalid match URLs
if (pathIndex == -1) pathIndex = match.length;
return match.slice(0, pathIndex) + '/*';
}
return match;

@@ -121,3 +98,2 @@ }),

}
if (manifest.manifest_version == 3 && options.hmrOptions) {

@@ -129,3 +105,2 @@ war.push({

}
const warResult = (manifest.web_accessible_resources || []).concat(manifest.manifest_version == 2 ? [...new Set(war.flatMap(entry => entry.resources))] : war);

@@ -144,5 +119,3 @@ if (warResult.length > 0) manifest.web_accessible_resources = warResult;

}
});
exports.default = _default;

10

package.json
{
"name": "@parcel/packager-webextension",
"version": "2.8.4-nightly.2926+cd4336412",
"version": "2.8.4-nightly.2937+3ad435157",
"license": "MIT",

@@ -20,10 +20,10 @@ "publishConfig": {

"node": ">=12.0.0",
"parcel": "2.0.0-nightly.1301+cd4336412"
"parcel": "2.0.0-nightly.1312+3ad435157"
},
"dependencies": {
"@parcel/plugin": "2.0.0-nightly.1303+cd4336412",
"@parcel/utils": "2.0.0-nightly.1303+cd4336412",
"@parcel/plugin": "2.0.0-nightly.1314+3ad435157",
"@parcel/utils": "2.0.0-nightly.1314+3ad435157",
"nullthrows": "^1.1.1"
},
"gitHead": "cd4336412242b6d6da40ef6cba8e7ac99c72b090"
"gitHead": "3ad435157d443da806c215d68ccf292b4e95ae0c"
}
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