extension-develop 3.0.0-next.9 → 3.1.0-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -16
- package/dist/215.js +546 -0
- package/dist/323.js +425 -0
- package/dist/419.js +44 -0
- package/dist/547.js +8444 -0
- package/dist/552.js +54 -0
- package/dist/928.js +416 -0
- package/dist/add-centralized-logger-script-background.js +3 -3
- package/dist/add-centralized-logger-script-content.js +4 -4
- package/dist/add-centralized-logger-script.js +18 -27
- package/dist/add-hmr-accept-code.js +3 -3
- package/dist/content-script-wrapper.js +114 -32
- package/dist/ensure-hmr-for-scripts.js +3 -3
- package/dist/extension-js-devtools/chrome/assets/logo.7dc70d61.png +0 -0
- package/dist/extension-js-devtools/chrome/background/service_worker.js +26 -0
- package/dist/extension-js-devtools/chrome/chrome_url_overrides/newtab.html +23 -0
- package/dist/extension-js-devtools/chrome/devtools/index.html +12 -0
- package/dist/extension-js-devtools/chrome/devtools/index.js +1 -0
- package/dist/extension-js-devtools/chrome/icons/logo.png +0 -0
- package/dist/extension-js-devtools/chrome/logo.png +0 -0
- package/dist/extension-js-devtools/chrome/manifest.json +44 -0
- package/dist/extension-js-devtools/chrome/pages/centralized-logger.css +2 -0
- package/dist/extension-js-devtools/chrome/pages/centralized-logger.html +12 -0
- package/dist/extension-js-devtools/chrome/pages/centralized-logger.js +16 -0
- package/dist/extension-js-devtools/chrome/pages/welcome.css +2 -0
- package/dist/extension-js-devtools/chrome/pages/welcome.html +11 -0
- package/dist/extension-js-devtools/chrome/pages/welcome.js +21 -0
- package/dist/extension-js-devtools/chrome/scripts/logger-client.js +1 -0
- package/dist/extension-js-devtools/chromium/assets/logo.7dc70d61.png +0 -0
- package/dist/extension-js-devtools/chromium/background/service_worker.js +26 -0
- package/dist/extension-js-devtools/chromium/chrome_url_overrides/newtab.html +23 -0
- package/dist/extension-js-devtools/chromium/devtools/index.html +12 -0
- package/dist/extension-js-devtools/chromium/devtools/index.js +1 -0
- package/dist/extension-js-devtools/chromium/icons/logo.png +0 -0
- package/dist/extension-js-devtools/chromium/logo.png +0 -0
- package/dist/extension-js-devtools/chromium/manifest.json +44 -0
- package/dist/extension-js-devtools/chromium/pages/centralized-logger.css +2 -0
- package/dist/extension-js-devtools/chromium/pages/centralized-logger.html +12 -0
- package/dist/extension-js-devtools/chromium/pages/centralized-logger.js +16 -0
- package/dist/extension-js-devtools/chromium/pages/welcome.css +2 -0
- package/dist/extension-js-devtools/chromium/pages/welcome.html +11 -0
- package/dist/extension-js-devtools/chromium/pages/welcome.js +21 -0
- package/dist/extension-js-devtools/chromium/scripts/logger-client.js +1 -0
- package/dist/extension-js-devtools/edge/assets/logo.7dc70d61.png +0 -0
- package/dist/extension-js-devtools/edge/background/service_worker.js +26 -0
- package/dist/extension-js-devtools/edge/chrome_url_overrides/newtab.html +23 -0
- package/dist/extension-js-devtools/edge/devtools/index.html +12 -0
- package/dist/extension-js-devtools/edge/devtools/index.js +1 -0
- package/dist/extension-js-devtools/edge/icons/logo.png +0 -0
- package/dist/extension-js-devtools/edge/logo.png +0 -0
- package/dist/extension-js-devtools/edge/manifest.json +44 -0
- package/dist/extension-js-devtools/edge/pages/centralized-logger.css +2 -0
- package/dist/extension-js-devtools/edge/pages/centralized-logger.html +12 -0
- package/dist/extension-js-devtools/edge/pages/centralized-logger.js +16 -0
- package/dist/extension-js-devtools/edge/pages/welcome.css +2 -0
- package/dist/extension-js-devtools/edge/pages/welcome.html +11 -0
- package/dist/extension-js-devtools/edge/pages/welcome.js +21 -0
- package/dist/extension-js-devtools/edge/scripts/logger-client.js +1 -0
- package/dist/extension-js-devtools/firefox/assets/logo.7dc70d61.png +0 -0
- package/dist/extension-js-devtools/firefox/background/scripts.js +26 -0
- package/dist/extension-js-devtools/firefox/devtools/index.html +12 -0
- package/dist/extension-js-devtools/firefox/devtools/index.js +1 -0
- package/dist/extension-js-devtools/firefox/icons/logo.png +0 -0
- package/dist/extension-js-devtools/firefox/logo.png +0 -0
- package/dist/extension-js-devtools/firefox/manifest.json +30 -0
- package/dist/extension-js-devtools/firefox/pages/centralized-logger.css +2 -0
- package/dist/extension-js-devtools/firefox/pages/centralized-logger.html +12 -0
- package/dist/extension-js-devtools/firefox/pages/centralized-logger.js +16 -0
- package/dist/extension-js-devtools/firefox/pages/welcome.css +2 -0
- package/dist/extension-js-devtools/firefox/pages/welcome.html +11 -0
- package/dist/extension-js-devtools/firefox/pages/welcome.js +21 -0
- package/dist/extension-js-devtools/firefox/scripts/logger-client.js +1 -0
- package/dist/main-world-bridge.js +109 -0
- package/dist/minimum-chromium-file.js +2 -3
- package/dist/minimum-firefox-file.js +2 -3
- package/dist/minimum-script-file.js +25 -1
- package/dist/module.js +132661 -13155
- package/dist/module.js.LICENSE.txt +24 -0
- package/dist/resolve-paths-loader.js +61 -102
- package/dist/warn-no-default-export.js +173 -10
- package/package.json +55 -49
- package/dist/930.js +0 -44
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* MIT License
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
6
|
+
*
|
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
* furnished to do so, subject to the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
* copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
* SOFTWARE.
|
|
24
|
+
*/
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
|
|
3
|
-
return 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
4
|
-
}();
|
|
5
2
|
var __webpack_modules__ = {
|
|
6
|
-
"@swc/core
|
|
3
|
+
"@swc/core" (module) {
|
|
7
4
|
module.exports = require("@swc/core");
|
|
8
|
-
},
|
|
9
|
-
"@swc/core?7929": function(module) {
|
|
10
|
-
module.exports = import("@swc/core").then(function(module) {
|
|
11
|
-
return module;
|
|
12
|
-
});
|
|
13
5
|
}
|
|
14
6
|
};
|
|
15
7
|
var __webpack_module_cache__ = {};
|
|
@@ -44,7 +36,7 @@ function __webpack_require__(moduleId) {
|
|
|
44
36
|
})();
|
|
45
37
|
(()=>{
|
|
46
38
|
__webpack_require__.r = (exports1)=>{
|
|
47
|
-
if (
|
|
39
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
48
40
|
value: 'Module'
|
|
49
41
|
});
|
|
50
42
|
Object.defineProperty(exports1, '__esModule', {
|
|
@@ -98,7 +90,7 @@ var __webpack_exports__ = {};
|
|
|
98
90
|
}
|
|
99
91
|
if ('MemberExpression' === currentExpression.type) {
|
|
100
92
|
const propertyNode = currentExpression.property;
|
|
101
|
-
if (
|
|
93
|
+
if (propertyNode?.type === 'Identifier') memberParts.unshift(propertyNode.value);
|
|
102
94
|
currentExpression = currentExpression.object;
|
|
103
95
|
continue;
|
|
104
96
|
}
|
|
@@ -109,8 +101,8 @@ var __webpack_exports__ = {};
|
|
|
109
101
|
function getPropName(propertyNode) {
|
|
110
102
|
if (!propertyNode || 'KeyValueProperty' !== propertyNode.type) return;
|
|
111
103
|
const keyNode = propertyNode.key;
|
|
112
|
-
if (
|
|
113
|
-
if (
|
|
104
|
+
if (keyNode?.type === 'Identifier') return keyNode.value;
|
|
105
|
+
if (keyNode?.type === 'StringLiteral') return keyNode.value;
|
|
114
106
|
}
|
|
115
107
|
function isHttpLike(input) {
|
|
116
108
|
return /^https?:\/\//i.test(input) || /^data:/i.test(input) || /^chrome:\/\//i.test(input) || /^moz-extension:\/\//i.test(input);
|
|
@@ -162,10 +154,7 @@ var __webpack_exports__ = {};
|
|
|
162
154
|
if (!node) return;
|
|
163
155
|
if (node && 'ParenExpression' === node.type) return evalStaticString(node.expression);
|
|
164
156
|
if (isStringLiteral(node)) return node.value;
|
|
165
|
-
if (isStaticTemplate(node))
|
|
166
|
-
var _node_quasis;
|
|
167
|
-
return null == (_node_quasis = node.quasis) ? void 0 : _node_quasis.map((quasi)=>quasi.raw ?? '').join('');
|
|
168
|
-
}
|
|
157
|
+
if (isStaticTemplate(node)) return node.quasis?.map((quasi)=>quasi.raw ?? '').join('');
|
|
169
158
|
if (node && 'BinaryExpression' === node.type && '+' === node.operator) {
|
|
170
159
|
const left = evalStaticString(node.left);
|
|
171
160
|
const right = evalStaticString(node.right);
|
|
@@ -173,13 +162,12 @@ var __webpack_exports__ = {};
|
|
|
173
162
|
}
|
|
174
163
|
}
|
|
175
164
|
function handleRuntimeCalls(node, source, rewriteValue, manifestPath) {
|
|
176
|
-
var _node_arguments;
|
|
177
165
|
if ('CallExpression' !== node.type) return false;
|
|
178
166
|
const memberChain = memberChainFromCallee(node.callee);
|
|
179
167
|
const apiRoot = memberChain[0];
|
|
180
168
|
if ('chrome' !== apiRoot && 'browser' !== apiRoot) return false;
|
|
181
169
|
const method = memberChain.join('.');
|
|
182
|
-
if ((method.endsWith('runtime.getURL') || method.endsWith('extension.getURL')) &&
|
|
170
|
+
if ((method.endsWith('runtime.getURL') || method.endsWith('extension.getURL')) && node.arguments?.[0]) {
|
|
183
171
|
const firstArgument = node.arguments[0].expression;
|
|
184
172
|
if (isStringLiteral(firstArgument)) {
|
|
185
173
|
const resolved = resolveLiteralToOutput(firstArgument.value, {
|
|
@@ -204,9 +192,8 @@ var __webpack_exports__ = {};
|
|
|
204
192
|
if ('chrome' !== apiRoot && 'browser' !== apiRoot) return false;
|
|
205
193
|
const method = memberChain.join('.');
|
|
206
194
|
if (method.endsWith('action.setIcon') || method.endsWith('pageAction.setIcon') || method.endsWith('browserAction.setIcon')) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
if ((null == firstArgument ? void 0 : firstArgument.type) === 'ObjectExpression') for (const propertyNode of firstArgument.properties || []){
|
|
195
|
+
const firstArgument = node.arguments?.[0]?.expression;
|
|
196
|
+
if (firstArgument?.type === 'ObjectExpression') for (const propertyNode of firstArgument.properties || []){
|
|
210
197
|
if ('KeyValueProperty' !== propertyNode.type) continue;
|
|
211
198
|
const keyName = getPropName(propertyNode);
|
|
212
199
|
if ('path' !== keyName) continue;
|
|
@@ -216,7 +203,7 @@ var __webpack_exports__ = {};
|
|
|
216
203
|
manifestPath
|
|
217
204
|
});
|
|
218
205
|
rewriteValue(valueNode, resolved, valueNode.value);
|
|
219
|
-
} else if (
|
|
206
|
+
} else if (valueNode?.type === 'ObjectExpression') {
|
|
220
207
|
for (const innerProperty of valueNode.properties || [])if ('KeyValueProperty' === innerProperty.type && isStringLiteral(innerProperty.value)) {
|
|
221
208
|
const resolved = resolveLiteralToOutput(innerProperty.value.value, {
|
|
222
209
|
manifestPath
|
|
@@ -258,9 +245,8 @@ var __webpack_exports__ = {};
|
|
|
258
245
|
return true;
|
|
259
246
|
}
|
|
260
247
|
if (method.endsWith('action.setPopup') || method.endsWith('pageAction.setPopup') || method.endsWith('browserAction.setPopup')) {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
if ((null == firstArgument ? void 0 : firstArgument.type) === 'ObjectExpression') for (const propertyNode of firstArgument.properties || []){
|
|
248
|
+
const firstArgument = node.arguments?.[0]?.expression;
|
|
249
|
+
if (firstArgument?.type === 'ObjectExpression') for (const propertyNode of firstArgument.properties || []){
|
|
264
250
|
if ('KeyValueProperty' !== propertyNode.type) continue;
|
|
265
251
|
const keyName = getPropName(propertyNode);
|
|
266
252
|
if ('popup' !== keyName) continue;
|
|
@@ -298,9 +284,8 @@ var __webpack_exports__ = {};
|
|
|
298
284
|
if ('chrome' !== apiRoot && 'browser' !== apiRoot) return false;
|
|
299
285
|
const method = memberChain.join('.');
|
|
300
286
|
if (method.endsWith('devtools.panels.create')) {
|
|
301
|
-
|
|
302
|
-
const
|
|
303
|
-
const pageArg = null == (_node_arguments1 = node.arguments) ? void 0 : null == (_node_arguments_1 = _node_arguments1[2]) ? void 0 : _node_arguments_1.expression;
|
|
287
|
+
const iconArg = node.arguments?.[1]?.expression;
|
|
288
|
+
const pageArg = node.arguments?.[2]?.expression;
|
|
304
289
|
let touched = false;
|
|
305
290
|
if (isStringLiteral(iconArg)) {
|
|
306
291
|
const resolved = resolveLiteralToOutput(iconArg.value, {
|
|
@@ -359,9 +344,8 @@ var __webpack_exports__ = {};
|
|
|
359
344
|
if ('chrome' !== apiRoot && 'browser' !== apiRoot) return false;
|
|
360
345
|
const method = memberChain.join('.');
|
|
361
346
|
if (method.endsWith('tabs.create') || method.endsWith('windows.create')) {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
if ((null == firstArgument ? void 0 : firstArgument.type) === 'ObjectExpression') for (const propertyNode of firstArgument.properties || []){
|
|
347
|
+
const firstArgument = node.arguments?.[0]?.expression;
|
|
348
|
+
if (firstArgument?.type === 'ObjectExpression') for (const propertyNode of firstArgument.properties || []){
|
|
365
349
|
if ('KeyValueProperty' !== propertyNode.type) continue;
|
|
366
350
|
const keyName = getPropName(propertyNode);
|
|
367
351
|
if ('url' !== keyName) continue;
|
|
@@ -371,8 +355,8 @@ var __webpack_exports__ = {};
|
|
|
371
355
|
manifestPath
|
|
372
356
|
});
|
|
373
357
|
rewriteValue(valueNode, resolved, valueNode.value);
|
|
374
|
-
} else if (
|
|
375
|
-
const literalNode =
|
|
358
|
+
} else if (valueNode?.type === 'ArrayExpression') for (const arrayElement of valueNode.elements || []){
|
|
359
|
+
const literalNode = arrayElement?.expression;
|
|
376
360
|
if (isStringLiteral(literalNode)) {
|
|
377
361
|
const resolved = resolveLiteralToOutput(literalNode.value, {
|
|
378
362
|
manifestPath
|
|
@@ -415,9 +399,8 @@ var __webpack_exports__ = {};
|
|
|
415
399
|
return true;
|
|
416
400
|
}
|
|
417
401
|
if (method.endsWith('tabs.update')) {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
if ((null == optionsArgument ? void 0 : optionsArgument.type) === 'ObjectExpression') for (const propertyNode of optionsArgument.properties || []){
|
|
402
|
+
const optionsArgument = node.arguments?.[1]?.expression || node.arguments?.[0]?.expression;
|
|
403
|
+
if (optionsArgument?.type === 'ObjectExpression') for (const propertyNode of optionsArgument.properties || []){
|
|
421
404
|
if ('KeyValueProperty' !== propertyNode.type) continue;
|
|
422
405
|
const keyName = getPropName(propertyNode);
|
|
423
406
|
if ('url' !== keyName) continue;
|
|
@@ -456,16 +439,16 @@ var __webpack_exports__ = {};
|
|
|
456
439
|
const method = memberChain.join('.');
|
|
457
440
|
if (method.endsWith("scripting.registerContentScripts")) {
|
|
458
441
|
for (const argumentNode of node.arguments || []){
|
|
459
|
-
const arrayExpressionNode =
|
|
442
|
+
const arrayExpressionNode = argumentNode?.expression;
|
|
460
443
|
if (arrayExpressionNode && 'ArrayExpression' === arrayExpressionNode.type) for (const arrayElement of arrayExpressionNode.elements || []){
|
|
461
|
-
const objectExpressionNode =
|
|
444
|
+
const objectExpressionNode = arrayElement?.expression;
|
|
462
445
|
if (objectExpressionNode && 'ObjectExpression' === objectExpressionNode.type) for (const propertyNode of objectExpressionNode.properties || []){
|
|
463
446
|
if ('KeyValueProperty' !== propertyNode.type) continue;
|
|
464
447
|
const keyName = getPropName(propertyNode);
|
|
465
448
|
if ('js' !== keyName && 'css' !== keyName) continue;
|
|
466
449
|
const valueNode = propertyNode.value;
|
|
467
450
|
if ('ArrayExpression' === valueNode.type) for (const innerItem of valueNode.elements || []){
|
|
468
|
-
const literalNode =
|
|
451
|
+
const literalNode = innerItem?.expression;
|
|
469
452
|
if (isStringLiteral(literalNode)) {
|
|
470
453
|
const resolved = resolveLiteralToOutput(literalNode.value, {
|
|
471
454
|
manifestPath
|
|
@@ -515,15 +498,14 @@ var __webpack_exports__ = {};
|
|
|
515
498
|
return true;
|
|
516
499
|
}
|
|
517
500
|
if (method.endsWith("scripting.executeScript") || method.endsWith("scripting.insertCSS")) {
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
if ((null == firstArgument ? void 0 : firstArgument.type) === 'ObjectExpression') for (const propertyNode of firstArgument.properties || []){
|
|
501
|
+
const firstArgument = node.arguments?.[0]?.expression;
|
|
502
|
+
if (firstArgument?.type === 'ObjectExpression') for (const propertyNode of firstArgument.properties || []){
|
|
521
503
|
if ('KeyValueProperty' !== propertyNode.type) continue;
|
|
522
504
|
const keyName = getPropName(propertyNode);
|
|
523
505
|
if ('files' !== keyName) continue;
|
|
524
506
|
const valueNode = propertyNode.value;
|
|
525
|
-
if (
|
|
526
|
-
const literalNode =
|
|
507
|
+
if (valueNode?.type === 'ArrayExpression') for (const arrayElement of valueNode.elements || []){
|
|
508
|
+
const literalNode = arrayElement?.expression;
|
|
527
509
|
if (isStringLiteral(literalNode)) {
|
|
528
510
|
const resolved = resolveLiteralToOutput(literalNode.value, {
|
|
529
511
|
manifestPath
|
|
@@ -558,9 +540,8 @@ var __webpack_exports__ = {};
|
|
|
558
540
|
if ('chrome' !== apiRoot && 'browser' !== apiRoot) return false;
|
|
559
541
|
const method = memberChain.join('.');
|
|
560
542
|
if (method.endsWith('tabs.executeScript') || method.endsWith('tabs.insertCSS')) {
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
if ((null == firstArgument ? void 0 : firstArgument.type) === 'ObjectExpression') for (const propertyNode of firstArgument.properties || []){
|
|
543
|
+
const firstArgument = node.arguments?.[0]?.expression;
|
|
544
|
+
if (firstArgument?.type === 'ObjectExpression') for (const propertyNode of firstArgument.properties || []){
|
|
564
545
|
if ('KeyValueProperty' !== propertyNode.type) continue;
|
|
565
546
|
const keyName = getPropName(propertyNode);
|
|
566
547
|
if ('file' !== keyName) continue;
|
|
@@ -598,8 +579,7 @@ var __webpack_exports__ = {};
|
|
|
598
579
|
if ('chrome' !== apiRoot && 'browser' !== apiRoot) return false;
|
|
599
580
|
const method = memberChain.join('.');
|
|
600
581
|
if (method.endsWith('sidePanel.setOptions') || method.endsWith('sidebarAction.setPanel')) {
|
|
601
|
-
|
|
602
|
-
const firstArgument = null == (_node_arguments = node.arguments) ? void 0 : null == (_node_arguments_ = _node_arguments[0]) ? void 0 : _node_arguments_.expression;
|
|
582
|
+
const firstArgument = node.arguments?.[0]?.expression;
|
|
603
583
|
if (method.endsWith('sidebarAction.setPanel')) {
|
|
604
584
|
const arg = firstArgument;
|
|
605
585
|
if (isStringLiteral(arg)) {
|
|
@@ -629,7 +609,7 @@ var __webpack_exports__ = {};
|
|
|
629
609
|
}
|
|
630
610
|
}
|
|
631
611
|
}
|
|
632
|
-
if (
|
|
612
|
+
if (firstArgument?.type === 'ObjectExpression') for (const propertyNode of firstArgument.properties || []){
|
|
633
613
|
if ('KeyValueProperty' !== propertyNode.type) continue;
|
|
634
614
|
const keyName = getPropName(propertyNode);
|
|
635
615
|
if ('path' === keyName || 'panel' === keyName || 'page' === keyName) {
|
|
@@ -668,9 +648,8 @@ var __webpack_exports__ = {};
|
|
|
668
648
|
if ('chrome' !== apiRoot && 'browser' !== apiRoot) return false;
|
|
669
649
|
const method = memberChain.join('.');
|
|
670
650
|
if (method.endsWith('notifications.create') || method.endsWith('notifications.update')) {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
if ((null == optionsArgument ? void 0 : optionsArgument.type) === 'ObjectExpression') {
|
|
651
|
+
const optionsArgument = node.arguments?.[1]?.expression || node.arguments?.[0]?.expression;
|
|
652
|
+
if (optionsArgument?.type === 'ObjectExpression') {
|
|
674
653
|
let touched = false;
|
|
675
654
|
for (const propertyNode of optionsArgument.properties || []){
|
|
676
655
|
if ('KeyValueProperty' !== propertyNode.type) continue;
|
|
@@ -715,15 +694,14 @@ var __webpack_exports__ = {};
|
|
|
715
694
|
if ('chrome' !== apiRoot && 'browser' !== apiRoot) return false;
|
|
716
695
|
const method = memberChain.join('.');
|
|
717
696
|
if (method.endsWith('contextMenus.create') || method.endsWith('contextMenus.update') || method.endsWith('menus.create') || method.endsWith('menus.update')) {
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
if ((null == firstArgument ? void 0 : firstArgument.type) === 'ObjectExpression') for (const propertyNode of firstArgument.properties || []){
|
|
697
|
+
const firstArgument = node.arguments?.[0]?.expression;
|
|
698
|
+
if (firstArgument?.type === 'ObjectExpression') for (const propertyNode of firstArgument.properties || []){
|
|
721
699
|
if ('KeyValueProperty' !== propertyNode.type) continue;
|
|
722
700
|
const keyNode = propertyNode.key;
|
|
723
|
-
const keyName =
|
|
701
|
+
const keyName = keyNode?.type === 'Identifier' ? keyNode.value : keyNode?.value;
|
|
724
702
|
if ('icons' !== keyName) continue;
|
|
725
703
|
const valueNode = propertyNode.value;
|
|
726
|
-
if (
|
|
704
|
+
if (valueNode?.type === 'ObjectExpression') for (const innerProperty of valueNode.properties || []){
|
|
727
705
|
if ('KeyValueProperty' !== innerProperty.type) continue;
|
|
728
706
|
const innerValue = innerProperty.value;
|
|
729
707
|
if (isStringLiteral(innerValue)) {
|
|
@@ -760,13 +738,12 @@ var __webpack_exports__ = {};
|
|
|
760
738
|
if ('chrome' !== apiRoot && 'browser' !== apiRoot) return false;
|
|
761
739
|
const method = memberChain.join('.');
|
|
762
740
|
if (method.endsWith('declarativeContent.SetIcon')) {
|
|
763
|
-
|
|
764
|
-
const arg0 = null == (_node_arguments = node.arguments) ? void 0 : _node_arguments[0];
|
|
741
|
+
const arg0 = node.arguments?.[0];
|
|
765
742
|
const optionsArgument = arg0 && arg0.expression || arg0;
|
|
766
|
-
if (
|
|
743
|
+
if (optionsArgument?.type === 'ObjectExpression') for (const propertyNode of optionsArgument.properties || []){
|
|
767
744
|
if ('KeyValueProperty' !== propertyNode.type) continue;
|
|
768
745
|
const keyNode = propertyNode.key;
|
|
769
|
-
const keyName =
|
|
746
|
+
const keyName = keyNode?.type === 'Identifier' ? keyNode.value : keyNode?.value;
|
|
770
747
|
if ('path' !== keyName) continue;
|
|
771
748
|
const valueNode = propertyNode.value;
|
|
772
749
|
if (isStringLiteral(valueNode)) {
|
|
@@ -774,7 +751,7 @@ var __webpack_exports__ = {};
|
|
|
774
751
|
manifestPath
|
|
775
752
|
});
|
|
776
753
|
rewriteValue(valueNode, resolved, valueNode.value);
|
|
777
|
-
} else if (
|
|
754
|
+
} else if (valueNode?.type === 'ObjectExpression') for (const innerProperty of valueNode.properties || []){
|
|
778
755
|
if ('KeyValueProperty' !== innerProperty.type) continue;
|
|
779
756
|
const innerValue = innerProperty.value;
|
|
780
757
|
if (isStringLiteral(innerValue)) {
|
|
@@ -864,21 +841,17 @@ var __webpack_exports__ = {};
|
|
|
864
841
|
function walkCandidate(containerNode, onCandidateValue) {
|
|
865
842
|
if (!containerNode) return;
|
|
866
843
|
if ('ArrayExpression' === containerNode.type) {
|
|
867
|
-
for (const elementNode of containerNode.elements || [])onCandidateValue(
|
|
844
|
+
for (const elementNode of containerNode.elements || [])onCandidateValue(elementNode?.expression);
|
|
868
845
|
return;
|
|
869
846
|
}
|
|
870
847
|
if ('ObjectExpression' === containerNode.type) for (const propertyNode of containerNode.properties || []){
|
|
871
|
-
var _propertyNode_value, _propertyNode_value1;
|
|
872
848
|
if ('KeyValueProperty' !== propertyNode.type) continue;
|
|
873
849
|
const key = getPropName(propertyNode);
|
|
874
850
|
if (key) {
|
|
875
851
|
if (ALLOWED_KEYS.has(key)) onCandidateValue(propertyNode.value);
|
|
876
|
-
if (
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
for (const sizeProp of propertyNode.value.properties || [])if ('KeyValueProperty' === sizeProp.type) onCandidateValue(sizeProp.value);
|
|
880
|
-
} else walkCandidate(propertyNode.value, onCandidateValue);
|
|
881
|
-
}
|
|
852
|
+
if (propertyNode.value?.type === 'ArrayExpression' || propertyNode.value?.type === 'ObjectExpression') if (('default_icon' === key || 'path' === key) && propertyNode.value?.type === 'ObjectExpression') {
|
|
853
|
+
for (const sizeProp of propertyNode.value.properties || [])if ('KeyValueProperty' === sizeProp.type) onCandidateValue(sizeProp.value);
|
|
854
|
+
} else walkCandidate(propertyNode.value, onCandidateValue);
|
|
882
855
|
}
|
|
883
856
|
}
|
|
884
857
|
}
|
|
@@ -889,7 +862,7 @@ var __webpack_exports__ = {};
|
|
|
889
862
|
if ('chrome' !== apiRoot && 'browser' !== apiRoot) return false;
|
|
890
863
|
let touched = false;
|
|
891
864
|
for (const argumentNode of node.arguments || []){
|
|
892
|
-
const expressionNode =
|
|
865
|
+
const expressionNode = argumentNode?.expression;
|
|
893
866
|
if (expressionNode) {
|
|
894
867
|
if ('ObjectExpression' === expressionNode.type || 'ArrayExpression' === expressionNode.type) walkCandidate(expressionNode, (candidateValue)=>{
|
|
895
868
|
const touchedBefore = touched;
|
|
@@ -953,8 +926,7 @@ var __webpack_exports__ = {};
|
|
|
953
926
|
});
|
|
954
927
|
const computed = normalizeLiteralPayload(resolved ?? p);
|
|
955
928
|
try {
|
|
956
|
-
|
|
957
|
-
null == (_ctx_onResolvedLiteral = ctx.onResolvedLiteral) || _ctx_onResolvedLiteral.call(ctx, p, resolved ?? void 0, offset);
|
|
929
|
+
ctx.onResolvedLiteral?.(p, resolved ?? void 0, offset);
|
|
958
930
|
} catch {}
|
|
959
931
|
return `${pre}${q}${computed}${q}${post}`;
|
|
960
932
|
} catch {
|
|
@@ -975,10 +947,7 @@ var __webpack_exports__ = {};
|
|
|
975
947
|
});
|
|
976
948
|
const computed = normalizeLiteralPayload(resolved ?? p);
|
|
977
949
|
try {
|
|
978
|
-
if (isLikelyApiContextAt(source, offset))
|
|
979
|
-
var _ctx_onResolvedLiteral;
|
|
980
|
-
null == (_ctx_onResolvedLiteral = ctx.onResolvedLiteral) || _ctx_onResolvedLiteral.call(ctx, p, resolved ?? void 0, offset);
|
|
981
|
-
}
|
|
950
|
+
if (isLikelyApiContextAt(source, offset)) ctx.onResolvedLiteral?.(p, resolved ?? void 0, offset);
|
|
982
951
|
} catch {}
|
|
983
952
|
return `${pre}${q}${computed}${q}`;
|
|
984
953
|
} catch {
|
|
@@ -1000,10 +969,7 @@ var __webpack_exports__ = {};
|
|
|
1000
969
|
});
|
|
1001
970
|
const computed = normalizeLiteralPayload(resolved ?? inner);
|
|
1002
971
|
try {
|
|
1003
|
-
if (isLikelyApiContextAt(source, offset))
|
|
1004
|
-
var _ctx_onResolvedLiteral;
|
|
1005
|
-
null == (_ctx_onResolvedLiteral = ctx.onResolvedLiteral) || _ctx_onResolvedLiteral.call(ctx, inner, resolved ?? void 0, offset);
|
|
1006
|
-
}
|
|
972
|
+
if (isLikelyApiContextAt(source, offset)) ctx.onResolvedLiteral?.(inner, resolved ?? void 0, offset);
|
|
1007
973
|
} catch {}
|
|
1008
974
|
return `${pre}'${computed}'`;
|
|
1009
975
|
} catch {
|
|
@@ -1027,10 +993,7 @@ var __webpack_exports__ = {};
|
|
|
1027
993
|
});
|
|
1028
994
|
const computed = normalizeLiteralPayload(resolved ?? concatenated);
|
|
1029
995
|
try {
|
|
1030
|
-
if (isLikelyApiContextAt(source, offset))
|
|
1031
|
-
var _ctx_onResolvedLiteral;
|
|
1032
|
-
null == (_ctx_onResolvedLiteral = ctx.onResolvedLiteral) || _ctx_onResolvedLiteral.call(ctx, concatenated, resolved ?? void 0, offset);
|
|
1033
|
-
}
|
|
996
|
+
if (isLikelyApiContextAt(source, offset)) ctx.onResolvedLiteral?.(concatenated, resolved ?? void 0, offset);
|
|
1034
997
|
} catch {}
|
|
1035
998
|
return `${pre}'${computed}'`;
|
|
1036
999
|
} catch {
|
|
@@ -1056,14 +1019,13 @@ var __webpack_exports__ = {};
|
|
|
1056
1019
|
const re = /(['"])(.*?)(\1)/g;
|
|
1057
1020
|
let match;
|
|
1058
1021
|
while(match = re.exec(inner)){
|
|
1059
|
-
var _ctx_onResolvedLiteral;
|
|
1060
1022
|
const raw = match[2];
|
|
1061
1023
|
const resolved = resolveLiteralToOutput(normalizeLiteralPayload(raw), {
|
|
1062
1024
|
manifestPath: ctx.manifestPath,
|
|
1063
1025
|
packageJsonDir: ctx.packageJsonDir,
|
|
1064
1026
|
authorFilePath: ctx.authorFilePath
|
|
1065
1027
|
});
|
|
1066
|
-
|
|
1028
|
+
ctx.onResolvedLiteral?.(raw, resolved ?? void 0, offset + match.index);
|
|
1067
1029
|
}
|
|
1068
1030
|
}
|
|
1069
1031
|
} catch {}
|
|
@@ -1095,14 +1057,13 @@ var __webpack_exports__ = {};
|
|
|
1095
1057
|
const re = /(['"])(.*?)(\1)/g;
|
|
1096
1058
|
let match;
|
|
1097
1059
|
while(match = re.exec(inner)){
|
|
1098
|
-
var _ctx_onResolvedLiteral;
|
|
1099
1060
|
const raw = match[2];
|
|
1100
1061
|
const resolved = resolveLiteralToOutput(normalizeLiteralPayload(raw), {
|
|
1101
1062
|
manifestPath: ctx.manifestPath,
|
|
1102
1063
|
packageJsonDir: ctx.packageJsonDir,
|
|
1103
1064
|
authorFilePath: ctx.authorFilePath
|
|
1104
1065
|
});
|
|
1105
|
-
|
|
1066
|
+
ctx.onResolvedLiteral?.(raw, resolved ?? void 0, offset + match.index);
|
|
1106
1067
|
}
|
|
1107
1068
|
}
|
|
1108
1069
|
} catch {}
|
|
@@ -1180,12 +1141,12 @@ var __webpack_exports__ = {};
|
|
|
1180
1141
|
async function loadSwc() {
|
|
1181
1142
|
if (swcRuntimeModule) return swcRuntimeModule;
|
|
1182
1143
|
try {
|
|
1183
|
-
const mod = await
|
|
1184
|
-
swcRuntimeModule =
|
|
1144
|
+
const mod = await import("@swc/core");
|
|
1145
|
+
swcRuntimeModule = mod?.default && mod.default.parse ? mod.default : mod;
|
|
1185
1146
|
} catch {
|
|
1186
1147
|
try {
|
|
1187
|
-
const mod = __webpack_require__("@swc/core
|
|
1188
|
-
swcRuntimeModule =
|
|
1148
|
+
const mod = __webpack_require__("@swc/core") || (0, external_module_namespaceObject.createRequire)(__filename)('@swc/core');
|
|
1149
|
+
swcRuntimeModule = mod?.default && mod.default.parse ? mod.default : mod;
|
|
1189
1150
|
} catch {}
|
|
1190
1151
|
}
|
|
1191
1152
|
return swcRuntimeModule || null;
|
|
@@ -1200,9 +1161,8 @@ var __webpack_exports__ = {};
|
|
|
1200
1161
|
});
|
|
1201
1162
|
}
|
|
1202
1163
|
async function resolvePathsLoader(source) {
|
|
1203
|
-
var _this_getOptions, _this;
|
|
1204
1164
|
const callback = this.async();
|
|
1205
|
-
const options =
|
|
1165
|
+
const options = this.getOptions?.() || {};
|
|
1206
1166
|
const manifestPath = options.manifestPath;
|
|
1207
1167
|
const packageJsonDir = options.packageJsonDir;
|
|
1208
1168
|
const outputPath = String(options.outputPath || '');
|
|
@@ -1210,13 +1170,12 @@ var __webpack_exports__ = {};
|
|
|
1210
1170
|
this.cacheable && this.cacheable();
|
|
1211
1171
|
const emittedBodies = new Set();
|
|
1212
1172
|
const emitStandardWarning = (headerFilePath, bodyLines)=>{
|
|
1213
|
-
var _this_emitWarning, _this;
|
|
1214
1173
|
const bodyMessage = bodyLines.join('\n');
|
|
1215
1174
|
if (emittedBodies.has(bodyMessage)) return;
|
|
1216
1175
|
emittedBodies.add(bodyMessage);
|
|
1217
1176
|
const warning = new Error(bodyMessage);
|
|
1218
1177
|
warning.file = headerFilePath;
|
|
1219
|
-
|
|
1178
|
+
this.emitWarning?.(warning);
|
|
1220
1179
|
};
|
|
1221
1180
|
const warnIfMissingPublic = (original, computed)=>{
|
|
1222
1181
|
try {
|
|
@@ -1318,7 +1277,7 @@ var __webpack_exports__ = {};
|
|
|
1318
1277
|
} catch {}
|
|
1319
1278
|
if (!computed) return;
|
|
1320
1279
|
try {
|
|
1321
|
-
const span =
|
|
1280
|
+
const span = node?.span;
|
|
1322
1281
|
if (span && 'number' == typeof span.start && 'number' == typeof span.end) {
|
|
1323
1282
|
const src = String(inputSource);
|
|
1324
1283
|
const before = src[span.start - 1];
|
|
@@ -1383,9 +1342,9 @@ var __webpack_exports__ = {};
|
|
|
1383
1342
|
}
|
|
1384
1343
|
})();
|
|
1385
1344
|
exports["default"] = __webpack_exports__["default"];
|
|
1386
|
-
for(var
|
|
1345
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
1387
1346
|
"default"
|
|
1388
|
-
].indexOf(
|
|
1347
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
1389
1348
|
Object.defineProperty(exports, '__esModule', {
|
|
1390
1349
|
value: true
|
|
1391
1350
|
});
|