extension-develop 2.0.0-alpha.28 → 2.0.0-alpha.29
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/dist/ensure-hmr-for-scripts.js +1 -1
- package/dist/extensions/gecko-based-manager-extension/background.js +57 -0
- package/dist/extensions/gecko-based-manager-extension/define-initial-tab.js +62 -0
- package/dist/extensions/gecko-based-manager-extension/manifest.json +16 -0
- package/dist/extensions/gecko-based-manager-extension/pages/sakura-dark.css +268 -0
- package/dist/extensions/gecko-based-manager-extension/pages/sakura.css +267 -0
- package/dist/extensions/gecko-based-manager-extension/pages/welcome.html +49 -0
- package/dist/extensions/gecko-based-manager-extension/pages/welcome.js +34 -0
- package/dist/extensions/gecko-based-manager-extension/public/logo.png +0 -0
- package/dist/extensions/gecko-based-manager-extension/reload-service.js +130 -0
- package/dist/inject-content-css-during-dev.js +2 -2
- package/dist/module.d.ts +14 -12
- package/dist/module.js +69 -69
- package/dist/resolver-loader.js +1 -1
- package/dist/resolver-module.mjs +1 -0
- package/package.json +3 -2
- package/dist/resolver-module.js +0 -1
- /package/dist/extensions/{chromium-manager-extension → chromium-based-manager-extension}/background.js +0 -0
- /package/dist/extensions/{chromium-manager-extension → chromium-based-manager-extension}/define-initial-tab.js +0 -0
- /package/dist/extensions/{chromium-manager-extension → chromium-based-manager-extension}/manifest.json +0 -0
- /package/dist/extensions/{chromium-manager-extension → chromium-based-manager-extension}/pages/sakura-dark.css +0 -0
- /package/dist/extensions/{chromium-manager-extension → chromium-based-manager-extension}/pages/sakura.css +0 -0
- /package/dist/extensions/{chromium-manager-extension → chromium-based-manager-extension}/pages/welcome.html +0 -0
- /package/dist/extensions/{chromium-manager-extension → chromium-based-manager-extension}/pages/welcome.js +0 -0
- /package/dist/extensions/{chromium-manager-extension → chromium-based-manager-extension}/public/logo.png +0 -0
- /package/dist/extensions/{chromium-manager-extension → chromium-based-manager-extension}/reload-service.js +0 -0
package/dist/resolver-loader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var T=Object.create;var d=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var H=(t,e)=>{for(var r in e)d(t,r,{get:e[r],enumerable:!0})},P=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of B(e))!G.call(t,s)&&s!==r&&d(t,s,{get:()=>e[s],enumerable:!(o=V(e,s))||o.enumerable});return t};var l=(t,e,r)=>(r=t!=null?T(z(t)):{},P(e||!t||!t.__esModule?d(r,"default",{value:t,enumerable:!0}):r,t)),K=t=>P(d({},"__esModule",{value:!0}),t);var rt={};H(rt,{default:()=>N});module.exports=K(rt);var f=l(require("path")),J=require("schema-utils");var _=require("@swc/core"),v=require("acorn"),y=l(require("acorn-walk")),x=require("astring");function Q(t,e){let r=t;for(let o=e.length-1;o>=0;o--){if(o===0)return r.type==="Identifier"&&r.name===e[o];if(r.type!=="MemberExpression"||r.property.type!=="Identifier"||r.property.name!==e[o])return!1;r=r.object}return!0}function n(t,e){let r=e.split(".");return Q(t,r)}function c(t,e){if(t.arguments.length===0)return;let r=t.arguments[0];t.arguments[0]={type:"CallExpression",callee:{type:"Identifier",name:e},arguments:[r]}}function m(t,e){if(t.arguments.length!==0){if(e==="chrome.devtools.panels.create"||e==="browser.devtools.panels.create")t.arguments[1]={type:"CallExpression",callee:{type:"Identifier",name:"r.solve"},arguments:[t.arguments[1]]},t.arguments[2]={type:"CallExpression",callee:{type:"Identifier",name:"r.solve"},arguments:[t.arguments[2]]};else if(e==="chrome.runtime.getURL"||e==="browser.runtime.getURL"){if(t.arguments[0].type==="Literal"&&t.arguments[0].value.includes("/_favicon/"))return;t.arguments[0]={type:"CallExpression",callee:{type:"Identifier",name:"r.solve"},arguments:[t.arguments[0]]}}}}function X(t,e,r,o){(n(t,`${o}.action.setIcon`)||n(t,`${o}.browserAction.setIcon`)||n(t,`${o}.pageAction.setIcon`)||n(t,`${o}.declarativeContent.SetIcon`)||n(t,`${o}.action.setPopup`)||n(t,`${o}.browserAction.setPopup`)||n(t,`${o}.pageAction.setPopup`)||n(t,`${o}.scriptBadge.setPopup`))&&c(r,"r.solve"),n(t,`${o}.devtools.panels.create`)&&m(r,`${o}.devtools.panels.create`),n(t,`${o}.downloads.download`)&&c(r,"r.solve"),n(t,`${o}.runtime.getURL`)&&m(r,`${o}.runtime.getURL`),(n(t,`${o}.scripting.insertCSS`)||n(t,`${o}.scripting.removeCSS`)||n(t,`${o}.scripting.executeScript`))&&c(r,"r.solve"),(n(t,`${o}.scripting.registerContentScripts`)||n(t,`${o}.declarativeContent.RequestContentScript`))&&c(r,"r.solve"),n(t,`${o}.declarativeContent.RequestContentScript`)&&c(r,"r.solve"),(n(t,`${o}.tabs.create`)||n(t,`${o}.tabs.executeScript`)||n(t,`${o}.tabs.insertCSS`)||n(t,`${o}.windows.create`))&&e.length>0&&c(r,"r.solve"),n(t,`${o}.sidePanel.setOptions`)&&c(r,"r.solve"),n(t,`${o}.notifications.create`)&&c(r,"r.solve")}function A(t,e){let r=(0,_.transformSync)(t,{module:{type:"es6"},minify:e.minify,jsc:{loose:!0,target:"es2016",parser:{syntax:e.typescript?"typescript":"ecmascript",jsx:!e.typescript&&e.jsx,tsx:e.typescript&&e.jsx,dynamicImport:!0},transform:{react:{runtime:"automatic",importSource:"react"}}}}),o=(0,v.parse)(r.code,{sourceType:"module",ecmaVersion:"latest"});return y.simple(o,{CallExpression(i){let a=["chrome","browser"],u=i.callee,g=i.arguments;a.forEach(p=>{X(u,g,i,p)})}}),(0,x.generate)(o)}var h=l(require("fs"));var b=l(require("path"));function M(t){if(!t||!t.background)return;let e=t.background.scripts;if(e)return e.map(r=>r)}function S(t){if(!t||!t.background)return;if(t.background.service_worker)return t.background.service_worker}function k(t){if(!t||!t.content_scripts)return{"content_scripts/content-0.js":void 0};let e=i=>{if(i.js?.length!==0)return i.js?.map(a=>a)},r=i=>{if(i.css?.length!==0)return i.css?.map(a=>a)},o={},s=t.content_scripts;for(let[i,a]of s.entries()){let u=e(a),g=r(a);o[`content_scripts/content-${i}`]=[...(u||[]).filter(p=>p!=null),...(g||[]).filter(p=>p!=null)]}return o}function D(t){return!t||!t.user_scripts||!t.user_scripts.api_script?void 0:t.user_scripts.api_script}function w(t){return!t||!t.action||!t.action.default_popup?void 0:t.action.default_popup}function L(t){return!t||!t.background||!t.background.page?void 0:t.background.page}function $(t){return!t||!t.browser_action||!t.browser_action.default_popup?void 0:t.browser_action.default_popup}function j(t){let e={newtab:void 0};return!t||!t.chrome_url_overrides?{"chrome_url_overrides/newtab.html":void 0}:(t.chrome_url_overrides.history&&(e={"chrome_url_overrides/history.html":t.chrome_url_overrides.history}),t.chrome_url_overrides.newtab&&(e={"chrome_url_overrides/newtab.html":t.chrome_url_overrides.newtab}),t.chrome_url_overrides.bookmarks&&(e={"chrome_url_overrides/bookmarks.html":t.chrome_url_overrides.bookmarks}),e)}function C(t){return!t||!t.devtools_page?void 0:t.devtools_page}function E(t){return t.options_page?t.options_page:!t||!t.options_ui||!t.options_ui.page?void 0:t.options_ui.page}function R(t){return!t||!t.page_action||!t.page_action.default_popup?void 0:t.page_action.default_popup}function I(t){if(!t||!t.sandbox||!t.sandbox.pages)return{"sandbox/page-0.html":void 0};let e=t.sandbox.pages,r={};for(let[o,s]of e.entries()){let i=s;r[`sandbox/page-${o}.html`]=i}return r}function O(t){return!t||!t.side_panel||!t.side_panel.default_path?void 0:t.side_panel.default_path}function F(t){return!t||!t.sidebar_action||!t.sidebar_action.default_panel?void 0:t.sidebar_action.default_panel}function U(t){return{"background/scripts.js":M(t),"background/service_worker.js":S(t),...k(t),"user_scripts/apiscript.js":D(t),"action/default_popup.html":w(t),"background/page.html":L(t),"browser_action/default_popup.html":$(t),...j(t),"devtools_page.html":C(t),"options_ui/page.html":E(t),"page_action/default_popup.html":R(t),...I(t),"side_panel/default_path.html":O(t),"sidebar_action/default_panel.html":F(t)}}function Y(t,e){let r=b.default.dirname(t);return Object.entries(e||{}).reduce((s,[i,a])=>{let u=b.default.relative(r,a);return s[i]=u,s},{})}function Z(t){let e=require(t);return U(e)}function W(t,e){let r=Y(t,e),o=Z(t);return{...r,...o}}function q(t,e){let r=t.getOptions(),{manifestPath:o,includeList:s}=r,i=JSON.stringify(W(o,s)),u=h.default.readFileSync(e,"utf8").replace('"__RESOLVER_MODULE_FILE_LIST__"',`${i}`);h.default.writeFileSync(e,u)}var tt={type:"object",properties:{test:{type:"string"},manifestPath:{type:"string"},includeList:{type:"object"},excludeList:{type:"object"},loaderOptions:{type:"object"}}};function et(t,e){if(!t.content_scripts)return[];let r=[];return t.content_scripts.forEach(o=>{o.js&&o.js.forEach(s=>{r.push(f.default.resolve(e,s))})}),r}function N(t){let e=this.getOptions();if((0,J.validate)(tt,e,{name:"resolve:loader",baseDataPath:"options"}),new RegExp(e.test).test(this.resourcePath)){let r="resolver-module.
|
|
1
|
+
"use strict";var T=Object.create;var d=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var H=(t,e)=>{for(var r in e)d(t,r,{get:e[r],enumerable:!0})},P=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of B(e))!G.call(t,s)&&s!==r&&d(t,s,{get:()=>e[s],enumerable:!(o=V(e,s))||o.enumerable});return t};var l=(t,e,r)=>(r=t!=null?T(z(t)):{},P(e||!t||!t.__esModule?d(r,"default",{value:t,enumerable:!0}):r,t)),K=t=>P(d({},"__esModule",{value:!0}),t);var rt={};H(rt,{default:()=>N});module.exports=K(rt);var f=l(require("path")),J=require("schema-utils");var _=require("@swc/core"),v=require("acorn"),y=l(require("acorn-walk")),x=require("astring");function Q(t,e){let r=t;for(let o=e.length-1;o>=0;o--){if(o===0)return r.type==="Identifier"&&r.name===e[o];if(r.type!=="MemberExpression"||r.property.type!=="Identifier"||r.property.name!==e[o])return!1;r=r.object}return!0}function n(t,e){let r=e.split(".");return Q(t,r)}function c(t,e){if(t.arguments.length===0)return;let r=t.arguments[0];t.arguments[0]={type:"CallExpression",callee:{type:"Identifier",name:e},arguments:[r]}}function m(t,e){if(t.arguments.length!==0){if(e==="chrome.devtools.panels.create"||e==="browser.devtools.panels.create")t.arguments[1]={type:"CallExpression",callee:{type:"Identifier",name:"r.solve"},arguments:[t.arguments[1]]},t.arguments[2]={type:"CallExpression",callee:{type:"Identifier",name:"r.solve"},arguments:[t.arguments[2]]};else if(e==="chrome.runtime.getURL"||e==="browser.runtime.getURL"){if(t.arguments[0].type==="Literal"&&t.arguments[0].value.includes("/_favicon/"))return;t.arguments[0]={type:"CallExpression",callee:{type:"Identifier",name:"r.solve"},arguments:[t.arguments[0]]}}}}function X(t,e,r,o){(n(t,`${o}.action.setIcon`)||n(t,`${o}.browserAction.setIcon`)||n(t,`${o}.pageAction.setIcon`)||n(t,`${o}.declarativeContent.SetIcon`)||n(t,`${o}.action.setPopup`)||n(t,`${o}.browserAction.setPopup`)||n(t,`${o}.pageAction.setPopup`)||n(t,`${o}.scriptBadge.setPopup`))&&c(r,"r.solve"),n(t,`${o}.devtools.panels.create`)&&m(r,`${o}.devtools.panels.create`),n(t,`${o}.downloads.download`)&&c(r,"r.solve"),n(t,`${o}.runtime.getURL`)&&m(r,`${o}.runtime.getURL`),(n(t,`${o}.scripting.insertCSS`)||n(t,`${o}.scripting.removeCSS`)||n(t,`${o}.scripting.executeScript`))&&c(r,"r.solve"),(n(t,`${o}.scripting.registerContentScripts`)||n(t,`${o}.declarativeContent.RequestContentScript`))&&c(r,"r.solve"),n(t,`${o}.declarativeContent.RequestContentScript`)&&c(r,"r.solve"),(n(t,`${o}.tabs.create`)||n(t,`${o}.tabs.executeScript`)||n(t,`${o}.tabs.insertCSS`)||n(t,`${o}.windows.create`))&&e.length>0&&c(r,"r.solve"),n(t,`${o}.sidePanel.setOptions`)&&c(r,"r.solve"),n(t,`${o}.notifications.create`)&&c(r,"r.solve")}function A(t,e){let r=(0,_.transformSync)(t,{module:{type:"es6"},minify:e.minify,jsc:{loose:!0,target:"es2016",parser:{syntax:e.typescript?"typescript":"ecmascript",jsx:!e.typescript&&e.jsx,tsx:e.typescript&&e.jsx,dynamicImport:!0},transform:{react:{runtime:"automatic",importSource:"react"}}}}),o=(0,v.parse)(r.code,{sourceType:"module",ecmaVersion:"latest"});return y.simple(o,{CallExpression(i){let a=["chrome","browser"],u=i.callee,g=i.arguments;a.forEach(p=>{X(u,g,i,p)})}}),(0,x.generate)(o)}var h=l(require("fs"));var b=l(require("path"));function M(t){if(!t||!t.background)return;let e=t.background.scripts;if(e)return e.map(r=>r)}function S(t){if(!t||!t.background)return;if(t.background.service_worker)return t.background.service_worker}function k(t){if(!t||!t.content_scripts)return{"content_scripts/content-0.js":void 0};let e=i=>{if(i.js?.length!==0)return i.js?.map(a=>a)},r=i=>{if(i.css?.length!==0)return i.css?.map(a=>a)},o={},s=t.content_scripts;for(let[i,a]of s.entries()){let u=e(a),g=r(a);o[`content_scripts/content-${i}`]=[...(u||[]).filter(p=>p!=null),...(g||[]).filter(p=>p!=null)]}return o}function D(t){return!t||!t.user_scripts||!t.user_scripts.api_script?void 0:t.user_scripts.api_script}function w(t){return!t||!t.action||!t.action.default_popup?void 0:t.action.default_popup}function L(t){return!t||!t.background||!t.background.page?void 0:t.background.page}function $(t){return!t||!t.browser_action||!t.browser_action.default_popup?void 0:t.browser_action.default_popup}function j(t){let e={newtab:void 0};return!t||!t.chrome_url_overrides?{"chrome_url_overrides/newtab.html":void 0}:(t.chrome_url_overrides.history&&(e={"chrome_url_overrides/history.html":t.chrome_url_overrides.history}),t.chrome_url_overrides.newtab&&(e={"chrome_url_overrides/newtab.html":t.chrome_url_overrides.newtab}),t.chrome_url_overrides.bookmarks&&(e={"chrome_url_overrides/bookmarks.html":t.chrome_url_overrides.bookmarks}),e)}function C(t){return!t||!t.devtools_page?void 0:t.devtools_page}function E(t){return t.options_page?t.options_page:!t||!t.options_ui||!t.options_ui.page?void 0:t.options_ui.page}function R(t){return!t||!t.page_action||!t.page_action.default_popup?void 0:t.page_action.default_popup}function I(t){if(!t||!t.sandbox||!t.sandbox.pages)return{"sandbox/page-0.html":void 0};let e=t.sandbox.pages,r={};for(let[o,s]of e.entries()){let i=s;r[`sandbox/page-${o}.html`]=i}return r}function O(t){return!t||!t.side_panel||!t.side_panel.default_path?void 0:t.side_panel.default_path}function F(t){return!t||!t.sidebar_action||!t.sidebar_action.default_panel?void 0:t.sidebar_action.default_panel}function U(t){return{"background/scripts.js":M(t),"background/service_worker.js":S(t),...k(t),"user_scripts/apiscript.js":D(t),"action/default_popup.html":w(t),"background/page.html":L(t),"browser_action/default_popup.html":$(t),...j(t),"devtools_page.html":C(t),"options_ui/page.html":E(t),"page_action/default_popup.html":R(t),...I(t),"side_panel/default_path.html":O(t),"sidebar_action/default_panel.html":F(t)}}function Y(t,e){let r=b.default.dirname(t);return Object.entries(e||{}).reduce((s,[i,a])=>{let u=b.default.relative(r,a);return s[i]=u,s},{})}function Z(t){let e=require(t);return U(e)}function W(t,e){let r=Y(t,e),o=Z(t);return{...r,...o}}function q(t,e){let r=t.getOptions(),{manifestPath:o,includeList:s}=r,i=JSON.stringify(W(o,s)),u=h.default.readFileSync(e,"utf8").replace('"__RESOLVER_MODULE_FILE_LIST__"',`${i}`);h.default.writeFileSync(e,u)}var tt={type:"object",properties:{test:{type:"string"},manifestPath:{type:"string"},includeList:{type:"object"},excludeList:{type:"object"},loaderOptions:{type:"object"}}};function et(t,e){if(!t.content_scripts)return[];let r=[];return t.content_scripts.forEach(o=>{o.js&&o.js.forEach(s=>{r.push(f.default.resolve(e,s))})}),r}function N(t){let e=this.getOptions();if((0,J.validate)(tt,e,{name:"resolve:loader",baseDataPath:"options"}),new RegExp(e.test).test(this.resourcePath)){let r="resolver-module.mjs";if(this.resourcePath.includes("node_modules")||this.resourcePath.includes("dist/"))return t;let o=f.default.dirname(e.manifestPath);if(et(require(e.manifestPath),o).some(u=>u===this.resourcePath))return t;let i=A(t,e),a=f.default.join(__dirname,r);return q(this,a),i}return t}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c={resolverNotFoundError(){console.error('Could not resolve file path. Ensure the file exists in the "public" or "pages" directory.')},resolverHtmlError:r=>(console.error(`Could not resolve path ${r}. Either add it to the "public" directory or create a page in the "pages" directory.`),r),resolverJsError:r=>`Could not resolve path ${r}. Either add it to the "public" directory or create a script in the "scripts" directory.`,resolverStaticError:r=>`Could not resolve path ${r}. If you want to preserve this file path, add the file to the "public" directory.`};function p(r){let n=r.split("/"),t=[];for(let s of n)s===".."||s==="."||s!==""&&t.push(s);return t.join("/")}function u(r){return r?.endsWith(".html")?(console.error(c.resolverHtmlError(r)),r):r?.endsWith(".js")?(console.error(c.resolverJsError(r)),r):(r&&console.error(c.resolverStaticError(r)),r)}var l={data:"__RESOLVER_MODULE_FILE_LIST__"};function e(r){if(!r)return c.resolverNotFoundError(),"";if(r?.startsWith("http")||r?.startsWith("chrome://")||r?.startsWith("about:"))return r;if(r?.startsWith("chrome-extension://")){let s=chrome.runtime.getURL("");if(r.startsWith(s)){let o=r.replace(s,"");return chrome.runtime.getURL(e(o))}return r}if(r?.startsWith("/_favicon"))return r;let n=Object.entries(l.data).find(([s,o])=>{let i=p(r);return o===i||o===`pages/${i}`||o===`scripts/${i}`?s:!1}),t=p(r);return t.includes("public/")?"/"+t:n&&n.length?n[0]:(r!=="/"&&u(r),r)}function a(r){if(typeof r=="string")return e(r);let n=t=>({...t,...t?.path&&{path:typeof t.path=="string"?e(t.path):Object.entries(t.path).reduce((s,[o,i])=>(s[o]=e(i),s),{})},...t?.popup&&{popup:e(t.popup)},...t?.url&&{url:Array.isArray(t?.url)?t?.url.map(s=>e(s)):e(t?.url)},...t?.iconUrl&&{iconUrl:e(t.iconUrl)},...t?.files&&{files:t.files.map(s=>e(s))},...t?.js&&{js:Array.isArray(t.js)?t.js.map(s=>e(s)):t.js},...t?.css&&{css:Array.isArray(t.css)?t.css.map(s=>e(s)):t.css}});return Array.isArray(r)?r.map(t=>n(t)):{...n(r||{})}}var g={solve:a},d=g;export{d as default};
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"node": ">=18"
|
|
10
10
|
},
|
|
11
11
|
"name": "extension-develop",
|
|
12
|
-
"version": "2.0.0-alpha.
|
|
12
|
+
"version": "2.0.0-alpha.29",
|
|
13
13
|
"description": "The develop step of Extension.js",
|
|
14
14
|
"main": "./dist/module.js",
|
|
15
15
|
"types": "./dist/module.d.ts",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"content-security-policy-parser": "^0.6.0",
|
|
38
38
|
"css-loader": "^6.10.0",
|
|
39
39
|
"csv-loader": "^3.0.5",
|
|
40
|
+
"dotenv": "^16.4.5",
|
|
40
41
|
"dotenv-webpack": "^8.0.1",
|
|
41
42
|
"edge-location": "^1.0.0",
|
|
42
43
|
"firefox-profile": "^4.6.0",
|
|
@@ -101,7 +102,7 @@
|
|
|
101
102
|
"clean": "rm -rf dist",
|
|
102
103
|
"watch": "tsup-node ./module.ts --format cjs --dts --target=node18 --watch",
|
|
103
104
|
"compile": "tsup-node ./module.ts --format cjs --dts --target=node18 --minify && bash install_scripts.sh",
|
|
104
|
-
"test": "jest --no-cache --testPathPattern='webpack/.*/__spec__/.*\\.spec
|
|
105
|
+
"test": "jest --no-cache --testPathPattern='webpack/.*/__spec__/.*\\.spec\\.*'",
|
|
105
106
|
"test:coverage": "jest --no-cache --testPathPattern='webpack/.*/__spec__/.*\\.spec\\.ts' --coverage",
|
|
106
107
|
"test:build": "jest ./build.spec.ts --no-cache"
|
|
107
108
|
}
|
package/dist/resolver-module.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var p=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var d=(r,e)=>{for(var t in e)p(r,t,{get:e[t],enumerable:!0})},y=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of a(e))!g.call(r,n)&&n!==t&&p(r,n,{get:()=>e[n],enumerable:!(s=l(e,n))||s.enumerable});return r};var v=r=>y(p({},"__esModule",{value:!0}),r);var U={};d(U,{default:()=>R});module.exports=v(U);var c={resolverNotFoundError(){console.error('Could not resolve file path. Ensure the file exists in the "public" or "pages" directory.')},resolverHtmlError:r=>(console.error(`Could not resolve path ${r}. Either add it to the "public" directory or create a page in the "pages" directory.`),r),resolverJsError:r=>`Could not resolve path ${r}. Either add it to the "public" directory or create a script in the "scripts" directory.`,resolverStaticError:r=>`Could not resolve path ${r}. If you want to preserve this file path, add the file to the "public" directory.`};function u(r){let e=r.split("/"),t=[];for(let s of e)s===".."||s==="."||s!==""&&t.push(s);return t.join("/")}function h(r){return r?.endsWith(".html")?(console.error(c.resolverHtmlError(r)),r):r?.endsWith(".js")?(console.error(c.resolverJsError(r)),r):(r&&console.error(c.resolverStaticError(r)),r)}var E={data:{"pages/index":"pages/index.html","scripts/content-script":"scripts/content-script.js"}};function o(r){if(!r)return c.resolverNotFoundError(),"";if(r?.startsWith("http")||r?.startsWith("chrome://")||r?.startsWith("about:"))return r;if(r?.startsWith("chrome-extension://")){let s=chrome.runtime.getURL("");if(r.startsWith(s)){let n=r.replace(s,"");return chrome.runtime.getURL(o(n))}return r}if(r?.startsWith("/_favicon"))return r;let e=Object.entries(E.data).find(([s,n])=>{let i=u(r);return n===i||n===`pages/${i}`||n===`scripts/${i}`?s:!1}),t=u(r);return t.includes("public/")?"/"+t:e&&e.length?e[0]:(r!=="/"&&h(r),r)}function f(r){if(typeof r=="string")return o(r);let e=t=>({...t,...t?.path&&{path:typeof t.path=="string"?o(t.path):Object.entries(t.path).reduce((s,[n,i])=>(s[n]=o(i),s),{})},...t?.popup&&{popup:o(t.popup)},...t?.url&&{url:Array.isArray(t?.url)?t?.url.map(s=>o(s)):o(t?.url)},...t?.iconUrl&&{iconUrl:o(t.iconUrl)},...t?.files&&{files:t.files.map(s=>o(s))},...t?.js&&{js:Array.isArray(t.js)?t.js.map(s=>o(s)):t.js},...t?.css&&{css:Array.isArray(t.css)?t.css.map(s=>o(s)):t.css}});return Array.isArray(r)?r.map(t=>e(t)):{...e(r||{})}}var m={solve:f},R=m;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|