extension-develop 4.1.23 → 4.1.24
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/832~0.mjs +1 -1
- package/dist/extension-js-devtools/chrome/assets/logo.1e52979e.png +0 -0
- package/dist/extension-js-devtools/chrome/images/icon-128.png +0 -0
- package/dist/extension-js-devtools/chrome/images/icon-16.png +0 -0
- package/dist/extension-js-devtools/chrome/images/icon-32.png +0 -0
- package/dist/extension-js-devtools/chrome/images/icon-48.png +0 -0
- package/dist/extension-js-devtools/chrome/pages/welcome.js +1 -1
- package/dist/extension-js-devtools/chromium/assets/logo.1e52979e.png +0 -0
- package/dist/extension-js-devtools/chromium/images/icon-128.png +0 -0
- package/dist/extension-js-devtools/chromium/images/icon-16.png +0 -0
- package/dist/extension-js-devtools/chromium/images/icon-32.png +0 -0
- package/dist/extension-js-devtools/chromium/images/icon-48.png +0 -0
- package/dist/extension-js-devtools/chromium/pages/welcome.js +1 -1
- package/dist/extension-js-devtools/edge/assets/logo.1e52979e.png +0 -0
- package/dist/extension-js-devtools/edge/images/icon-128.png +0 -0
- package/dist/extension-js-devtools/edge/images/icon-16.png +0 -0
- package/dist/extension-js-devtools/edge/images/icon-32.png +0 -0
- package/dist/extension-js-devtools/edge/images/icon-48.png +0 -0
- package/dist/extension-js-devtools/edge/pages/welcome.js +1 -1
- package/dist/extension-js-devtools/firefox/assets/logo.1e52979e.png +0 -0
- package/dist/extension-js-devtools/firefox/images/icon-128.png +0 -0
- package/dist/extension-js-devtools/firefox/images/icon-16.png +0 -0
- package/dist/extension-js-devtools/firefox/images/icon-32.png +0 -0
- package/dist/extension-js-devtools/firefox/images/icon-48.png +0 -0
- package/dist/extension-js-devtools/firefox/pages/welcome.js +1 -1
- package/dist/plugin-web-extension/feature-manifest/steps/apply-dev-defaults-lib/dev-injected-permissions.d.ts +2 -1
- package/dist/rspack-config~0.mjs +17 -4
- package/package.json +2 -2
- package/dist/extension-js-devtools/chrome/assets/logo.7dc70d61.png +0 -0
- package/dist/extension-js-devtools/chromium/assets/logo.7dc70d61.png +0 -0
- package/dist/extension-js-devtools/edge/assets/logo.7dc70d61.png +0 -0
- package/dist/extension-js-devtools/firefox/assets/logo.7dc70d61.png +0 -0
package/dist/832~0.mjs
CHANGED
|
@@ -19,7 +19,7 @@ import * as __rspack_external_node_fs_1b05aee1 from "node:fs";
|
|
|
19
19
|
import * as __rspack_external_node_os_4f3c9d58 from "node:os";
|
|
20
20
|
import * as __rspack_external_node_path_806ed179 from "node:path";
|
|
21
21
|
import * as __rspack_external_node_vm_ef240610 from "node:vm";
|
|
22
|
-
var package_namespaceObject = /*#__PURE__*/ JSON.parse('{"rE":"4.1.
|
|
22
|
+
var package_namespaceObject = /*#__PURE__*/ JSON.parse('{"rE":"4.1.24","El":{"@prefresh/core":"1.5.9","@prefresh/utils":"1.2.1","@rspack/core":"2.2.3","@rspack/dev-server":"2.1.0","@rspack/plugin-preact-refresh":"2.0.1","@rspack/plugin-react-refresh":"2.0.2","@vue/compiler-sfc":"3.5.26","acorn":"^8.16.0","browser-extension-manifest-fields":"^3.0.1","case-sensitive-paths-webpack-plugin":"^2.4.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^17.2.3","es-module-lexer":"^3.0.2","extension-from-store":"^0.2.5","fflate":"^0.8.3","go-git-it":"^5.1.5","ignore":"^7.0.5","less":"4.9.1","less-loader":"13.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","postcss":"8.5.23","postcss-loader":"8.2.1","postcss-preset-env":"11.1.1","postcss-scss":"4.0.9","preact":"10.27.3","prefers-yarn":"2.0.1","react-refresh":"0.18.0","sass-loader":"17.0.0","schema-utils":"^4.3.3","svelte-loader":"3.2.4","tiny-glob":"^0.2.9","vue":"3.5.26","vue-loader":"17.4.2","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.20.1"}}');
|
|
23
23
|
const preloadedEnvKeys = new Set();
|
|
24
24
|
function getPreloadedEnvKeys() {
|
|
25
25
|
return preloadedEnvKeys;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{"use strict";let e,t,n,r,i,o,a,s,l,c,m,d,u,p;var f={};function h(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return __webpack_modules__[e](n,n.exports,h),n.exports}h.p="/",(()=>{var e=!!(()=>{try{return globalThis.browser.runtime.getURL("/")}catch(e){}})(),t=!!(()=>{try{return globalThis.chrome.runtime.getURL("/")}catch(e){}})(),n=e?globalThis.browser:t?globalThis.chrome:{runtime:{getURL:e=>e}},r="object"==typeof globalThis&&globalThis&&globalThis.__EXTJS_EXTENSION_BASE__?String(globalThis.__EXTJS_EXTENSION_BASE__):"";if(!r&&"object"==typeof document&&document&&document.documentElement)try{r=document.documentElement.getAttribute("data-extjs-extension-base")||""}catch(e){r=""}var i="";if("function"!=typeof importScripts&&(e||t))try{i=n.runtime.getURL("/")}catch(e){i=""}h.p="function"==typeof importScripts?"/":i||(r?r.replace(/\/+$/,"/")+String("/").replace(/^\/+/,""):"/")})();let g=h.p+"assets/logo.
|
|
1
|
+
(()=>{"use strict";let e,t,n,r,i,o,a,s,l,c,m,d,u,p;var f={};function h(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return __webpack_modules__[e](n,n.exports,h),n.exports}h.p="/",(()=>{var e=!!(()=>{try{return globalThis.browser.runtime.getURL("/")}catch(e){}})(),t=!!(()=>{try{return globalThis.chrome.runtime.getURL("/")}catch(e){}})(),n=e?globalThis.browser:t?globalThis.chrome:{runtime:{getURL:e=>e}},r="object"==typeof globalThis&&globalThis&&globalThis.__EXTJS_EXTENSION_BASE__?String(globalThis.__EXTJS_EXTENSION_BASE__):"";if(!r&&"object"==typeof document&&document&&document.documentElement)try{r=document.documentElement.getAttribute("data-extjs-extension-base")||""}catch(e){r=""}var i="";if("function"!=typeof importScripts&&(e||t))try{i=n.runtime.getURL("/")}catch(e){i=""}h.p="function"==typeof importScripts?"/":i||(r?r.replace(/\/+$/,"/")+String("/").replace(/^\/+/,""):"/")})();let g=h.p+"assets/logo.1e52979e.png";async function x(){try{if(!chrome.management.getAll)return[];return(await new Promise(e=>{chrome.management.getAll(e)})||[]).filter(e=>{let t;return e.id!==chrome.runtime.id&&"igcijhgmihmjbbahdabahfbpffalcfnn"!==e.id&&"development"===e.installType&&"theme"!==e.type&&!0===e.enabled&&!((t=String(e.name||"").toLowerCase()).includes("extension.js built-in developer tools")||t.includes("extension.js theme"))})}catch{return[]}}async function b(){let e=await x();return e[e.length-1]}!function(e,t=document.documentElement){"dark"===(e??function(){let e=function(){try{let e=localStorage.getItem("theme");if("light"===e||"dark"===e)return e}catch{}return null}();if(e)return e;if("u">typeof window&&"matchMedia"in window)try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{}return"light"}())?t.classList.add("dark"):t.classList.remove("dark")}("dark");let y="firefox"===String("chrome").toLowerCase(),v="My Extension",w="Extension.js makes cross‑browser extension development simple.";function _(e,t,n){let r=document.createElement(e);return t&&(r.className=t),void 0!==n&&(r.textContent=n),r}function E(e){let t=_("a",e);return t.href="https://extension.js.org/",t.target="_blank",t.rel="noopener noreferrer",t}async function j(){let e=await b();if(e)return e;let t=(await new Promise(e=>{try{chrome.management.getAll(e)}catch{e([])}})||[]).filter(e=>e&&"development"===e.installType&&e.id!==chrome.runtime.id&&e.enabled&&"theme"!==e.type),n=t.length?t[t.length-1]:void 0;if(n)return n;let r=chrome.runtime.getManifest();return{id:chrome.runtime.id,name:r?.name||"Extension",shortName:r?.short_name,description:r?.description||"",version:r?.version||"",enabled:!0,installType:"development"}}let T=document.getElementById("root");T&&(e=_("div","relative flex h-screen flex-col items-center justify-center bg-[#1C1C1E]"),t=_("header","mb-4 flex w-full items-center justify-center"),(n=_("img","size-16 select-none object-contain")).alt="User extension icon",n.src=g,r=!1,n.addEventListener("error",()=>{r||(r=!0,n.src=g)}),t.append(n),i=_("h1","text-foreground mx-auto text-center text-3xl font-semibold leading-tight tracking-tight sm:text-4xl"),o=_("span",void 0,v),(a=_("span","neon-text","loaded successfully")).id="extensionName",a.style.color="var(--brand-success, #19f5a7)",i.append(o,_("br"),a),s=_("p","text-muted-foreground mx-auto mt-3 max-w-xl text-center text-base leading-relaxed sm:text-lg",w),e.append(t,i,s,(l=_("div","mt-6 flex w-full items-center justify-center"),c=_("div","relative inline-flex items-center gap-3 rounded-2xl border px-4 py-2 shadow-sm backdrop-blur"),m=_("div","flex flex-wrap items-center gap-3"),(d=E("inline-flex items-center gap-2")).setAttribute("aria-label","Visit extension.js.org"),(u=_("img","size-4 select-none")).alt="Extension.js logo",u.src=g,d.append(u,_("span","sr-only","extension.js")),(p=E("text-muted-foreground text-sm underline underline-offset-4 hover:opacity-90")).textContent="Learn more about developing cross-browser extensions.",m.append(d,p),c.append(m),l.append(c),l)),T.replaceChildren(e),j().then(async e=>{o.textContent=e.name||v,a.title=`• Name: ${e.name}
|
|
2
2
|
• ID: ${e.id}
|
|
3
3
|
• Version: ${e.version}`,s.textContent=e.description||w,n.alt=`${e.name||"User extension"} icon`;let t=function(e){if(e.icons&&e.icons.length)return[...e.icons].sort((e,t)=>(t.size||0)-(e.size||0))[0]?.url}(e);if(t){if(y&&!t.startsWith("data:")){let e=await new Promise(e=>{try{chrome.runtime.sendMessage({type:"resolve-icon-url",url:t},t=>{e(t?.ok&&"string"==typeof t.dataUrl?t.dataUrl:void 0)})}catch{e(void 0)}});e&&!r&&(n.src=e);return}r||(n.src=t)}}).catch(()=>{}))})();
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{"use strict";let e,t,n,r,i,o,a,s,l,c,m,d,u,p;var f={};function h(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return __webpack_modules__[e](n,n.exports,h),n.exports}h.p="/",(()=>{var e=!!(()=>{try{return globalThis.browser.runtime.getURL("/")}catch(e){}})(),t=!!(()=>{try{return globalThis.chrome.runtime.getURL("/")}catch(e){}})(),n=e?globalThis.browser:t?globalThis.chrome:{runtime:{getURL:e=>e}},r="object"==typeof globalThis&&globalThis&&globalThis.__EXTJS_EXTENSION_BASE__?String(globalThis.__EXTJS_EXTENSION_BASE__):"";if(!r&&"object"==typeof document&&document&&document.documentElement)try{r=document.documentElement.getAttribute("data-extjs-extension-base")||""}catch(e){r=""}var i="";if("function"!=typeof importScripts&&(e||t))try{i=n.runtime.getURL("/")}catch(e){i=""}h.p="function"==typeof importScripts?"/":i||(r?r.replace(/\/+$/,"/")+String("/").replace(/^\/+/,""):"/")})();let g=h.p+"assets/logo.
|
|
1
|
+
(()=>{"use strict";let e,t,n,r,i,o,a,s,l,c,m,d,u,p;var f={};function h(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return __webpack_modules__[e](n,n.exports,h),n.exports}h.p="/",(()=>{var e=!!(()=>{try{return globalThis.browser.runtime.getURL("/")}catch(e){}})(),t=!!(()=>{try{return globalThis.chrome.runtime.getURL("/")}catch(e){}})(),n=e?globalThis.browser:t?globalThis.chrome:{runtime:{getURL:e=>e}},r="object"==typeof globalThis&&globalThis&&globalThis.__EXTJS_EXTENSION_BASE__?String(globalThis.__EXTJS_EXTENSION_BASE__):"";if(!r&&"object"==typeof document&&document&&document.documentElement)try{r=document.documentElement.getAttribute("data-extjs-extension-base")||""}catch(e){r=""}var i="";if("function"!=typeof importScripts&&(e||t))try{i=n.runtime.getURL("/")}catch(e){i=""}h.p="function"==typeof importScripts?"/":i||(r?r.replace(/\/+$/,"/")+String("/").replace(/^\/+/,""):"/")})();let g=h.p+"assets/logo.1e52979e.png";async function x(){try{if(!chrome.management.getAll)return[];return(await new Promise(e=>{chrome.management.getAll(e)})||[]).filter(e=>{let t;return e.id!==chrome.runtime.id&&"igcijhgmihmjbbahdabahfbpffalcfnn"!==e.id&&"development"===e.installType&&"theme"!==e.type&&!0===e.enabled&&!((t=String(e.name||"").toLowerCase()).includes("extension.js built-in developer tools")||t.includes("extension.js theme"))})}catch{return[]}}async function b(){let e=await x();return e[e.length-1]}!function(e,t=document.documentElement){"dark"===(e??function(){let e=function(){try{let e=localStorage.getItem("theme");if("light"===e||"dark"===e)return e}catch{}return null}();if(e)return e;if("u">typeof window&&"matchMedia"in window)try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{}return"light"}())?t.classList.add("dark"):t.classList.remove("dark")}("dark");let y="firefox"===String("chromium").toLowerCase(),v="My Extension",w="Extension.js makes cross‑browser extension development simple.";function _(e,t,n){let r=document.createElement(e);return t&&(r.className=t),void 0!==n&&(r.textContent=n),r}function E(e){let t=_("a",e);return t.href="https://extension.js.org/",t.target="_blank",t.rel="noopener noreferrer",t}async function j(){let e=await b();if(e)return e;let t=(await new Promise(e=>{try{chrome.management.getAll(e)}catch{e([])}})||[]).filter(e=>e&&"development"===e.installType&&e.id!==chrome.runtime.id&&e.enabled&&"theme"!==e.type),n=t.length?t[t.length-1]:void 0;if(n)return n;let r=chrome.runtime.getManifest();return{id:chrome.runtime.id,name:r?.name||"Extension",shortName:r?.short_name,description:r?.description||"",version:r?.version||"",enabled:!0,installType:"development"}}let T=document.getElementById("root");T&&(e=_("div","relative flex h-screen flex-col items-center justify-center bg-[#1C1C1E]"),t=_("header","mb-4 flex w-full items-center justify-center"),(n=_("img","size-16 select-none object-contain")).alt="User extension icon",n.src=g,r=!1,n.addEventListener("error",()=>{r||(r=!0,n.src=g)}),t.append(n),i=_("h1","text-foreground mx-auto text-center text-3xl font-semibold leading-tight tracking-tight sm:text-4xl"),o=_("span",void 0,v),(a=_("span","neon-text","loaded successfully")).id="extensionName",a.style.color="var(--brand-success, #19f5a7)",i.append(o,_("br"),a),s=_("p","text-muted-foreground mx-auto mt-3 max-w-xl text-center text-base leading-relaxed sm:text-lg",w),e.append(t,i,s,(l=_("div","mt-6 flex w-full items-center justify-center"),c=_("div","relative inline-flex items-center gap-3 rounded-2xl border px-4 py-2 shadow-sm backdrop-blur"),m=_("div","flex flex-wrap items-center gap-3"),(d=E("inline-flex items-center gap-2")).setAttribute("aria-label","Visit extension.js.org"),(u=_("img","size-4 select-none")).alt="Extension.js logo",u.src=g,d.append(u,_("span","sr-only","extension.js")),(p=E("text-muted-foreground text-sm underline underline-offset-4 hover:opacity-90")).textContent="Learn more about developing cross-browser extensions.",m.append(d,p),c.append(m),l.append(c),l)),T.replaceChildren(e),j().then(async e=>{o.textContent=e.name||v,a.title=`• Name: ${e.name}
|
|
2
2
|
• ID: ${e.id}
|
|
3
3
|
• Version: ${e.version}`,s.textContent=e.description||w,n.alt=`${e.name||"User extension"} icon`;let t=function(e){if(e.icons&&e.icons.length)return[...e.icons].sort((e,t)=>(t.size||0)-(e.size||0))[0]?.url}(e);if(t){if(y&&!t.startsWith("data:")){let e=await new Promise(e=>{try{chrome.runtime.sendMessage({type:"resolve-icon-url",url:t},t=>{e(t?.ok&&"string"==typeof t.dataUrl?t.dataUrl:void 0)})}catch{e(void 0)}});e&&!r&&(n.src=e);return}r||(n.src=t)}}).catch(()=>{}))})();
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{"use strict";let e,t,n,r,i,o,a,s,l,c,d,
|
|
1
|
+
(()=>{"use strict";let e,t,n,r,i,o,a,s,l,c,m,d,u,p;var f={};function g(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return __webpack_modules__[e](n,n.exports,g),n.exports}g.p="/",(()=>{var e=!!(()=>{try{return globalThis.browser.runtime.getURL("/")}catch(e){}})(),t=!!(()=>{try{return globalThis.chrome.runtime.getURL("/")}catch(e){}})(),n=e?globalThis.browser:t?globalThis.chrome:{runtime:{getURL:e=>e}},r="object"==typeof globalThis&&globalThis&&globalThis.__EXTJS_EXTENSION_BASE__?String(globalThis.__EXTJS_EXTENSION_BASE__):"";if(!r&&"object"==typeof document&&document&&document.documentElement)try{r=document.documentElement.getAttribute("data-extjs-extension-base")||""}catch(e){r=""}var i="";if("function"!=typeof importScripts&&(e||t))try{i=n.runtime.getURL("/")}catch(e){i=""}g.p="function"==typeof importScripts?"/":i||(r?r.replace(/\/+$/,"/")+String("/").replace(/^\/+/,""):"/")})();let h=g.p+"assets/logo.1e52979e.png";async function x(){try{if(!chrome.management.getAll)return[];return(await new Promise(e=>{chrome.management.getAll(e)})||[]).filter(e=>{let t;return e.id!==chrome.runtime.id&&"igcijhgmihmjbbahdabahfbpffalcfnn"!==e.id&&"development"===e.installType&&"theme"!==e.type&&!0===e.enabled&&!((t=String(e.name||"").toLowerCase()).includes("extension.js built-in developer tools")||t.includes("extension.js theme"))})}catch{return[]}}async function b(){let e=await x();return e[e.length-1]}!function(e,t=document.documentElement){"dark"===(e??function(){let e=function(){try{let e=localStorage.getItem("theme");if("light"===e||"dark"===e)return e}catch{}return null}();if(e)return e;if("u">typeof window&&"matchMedia"in window)try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{}return"light"}())?t.classList.add("dark"):t.classList.remove("dark")}("dark");let y="firefox"===String("edge").toLowerCase(),v="My Extension",w="Extension.js makes cross‑browser extension development simple.";function _(e,t,n){let r=document.createElement(e);return t&&(r.className=t),void 0!==n&&(r.textContent=n),r}function E(e){let t=_("a",e);return t.href="https://extension.js.org/",t.target="_blank",t.rel="noopener noreferrer",t}async function j(){let e=await b();if(e)return e;let t=(await new Promise(e=>{try{chrome.management.getAll(e)}catch{e([])}})||[]).filter(e=>e&&"development"===e.installType&&e.id!==chrome.runtime.id&&e.enabled&&"theme"!==e.type),n=t.length?t[t.length-1]:void 0;if(n)return n;let r=chrome.runtime.getManifest();return{id:chrome.runtime.id,name:r?.name||"Extension",shortName:r?.short_name,description:r?.description||"",version:r?.version||"",enabled:!0,installType:"development"}}let T=document.getElementById("root");T&&(e=_("div","relative flex h-screen flex-col items-center justify-center bg-[#1C1C1E]"),t=_("header","mb-4 flex w-full items-center justify-center"),(n=_("img","size-16 select-none object-contain")).alt="User extension icon",n.src=h,r=!1,n.addEventListener("error",()=>{r||(r=!0,n.src=h)}),t.append(n),i=_("h1","text-foreground mx-auto text-center text-3xl font-semibold leading-tight tracking-tight sm:text-4xl"),o=_("span",void 0,v),(a=_("span","neon-text","loaded successfully")).id="extensionName",a.style.color="var(--brand-success, #19f5a7)",i.append(o,_("br"),a),s=_("p","text-muted-foreground mx-auto mt-3 max-w-xl text-center text-base leading-relaxed sm:text-lg",w),e.append(t,i,s,(l=_("div","mt-6 flex w-full items-center justify-center"),c=_("div","relative inline-flex items-center gap-3 rounded-2xl border px-4 py-2 shadow-sm backdrop-blur"),m=_("div","flex flex-wrap items-center gap-3"),(d=E("inline-flex items-center gap-2")).setAttribute("aria-label","Visit extension.js.org"),(u=_("img","size-4 select-none")).alt="Extension.js logo",u.src=h,d.append(u,_("span","sr-only","extension.js")),(p=E("text-muted-foreground text-sm underline underline-offset-4 hover:opacity-90")).textContent="Learn more about developing cross-browser extensions.",m.append(d,p),c.append(m),l.append(c),l)),T.replaceChildren(e),j().then(async e=>{o.textContent=e.name||v,a.title=`• Name: ${e.name}
|
|
2
2
|
• ID: ${e.id}
|
|
3
3
|
• Version: ${e.version}`,s.textContent=e.description||w,n.alt=`${e.name||"User extension"} icon`;let t=function(e){if(e.icons&&e.icons.length)return[...e.icons].sort((e,t)=>(t.size||0)-(e.size||0))[0]?.url}(e);if(t){if(y&&!t.startsWith("data:")){let e=await new Promise(e=>{try{chrome.runtime.sendMessage({type:"resolve-icon-url",url:t},t=>{e(t?.ok&&"string"==typeof t.dataUrl?t.dataUrl:void 0)})}catch{e(void 0)}});e&&!r&&(n.src=e);return}r||(n.src=t)}}).catch(()=>{}))})();
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(()=>{"use strict";let e,t,n,r,i,o,a,s,l,c,d,
|
|
1
|
+
(()=>{"use strict";let e,t,n,r,i,o,a,s,l,c,m,d,u,p;var f={};function h(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return __webpack_modules__[e](n,n.exports,h),n.exports}h.p="/",(()=>{var e=!!(()=>{try{return globalThis.browser.runtime.getURL("/")}catch(e){}})(),t=!!(()=>{try{return globalThis.chrome.runtime.getURL("/")}catch(e){}})(),n=e?globalThis.browser:t?globalThis.chrome:{runtime:{getURL:e=>e}},r="object"==typeof globalThis&&globalThis&&globalThis.__EXTJS_EXTENSION_BASE__?String(globalThis.__EXTJS_EXTENSION_BASE__):"";if(!r&&"object"==typeof document&&document&&document.documentElement)try{r=document.documentElement.getAttribute("data-extjs-extension-base")||""}catch(e){r=""}var i="";if("function"!=typeof importScripts&&(e||t))try{i=n.runtime.getURL("/")}catch(e){i=""}h.p="function"==typeof importScripts?"/":i||(r?r.replace(/\/+$/,"/")+String("/").replace(/^\/+/,""):"/")})();let g=h.p+"assets/logo.1e52979e.png";async function x(){try{if(!chrome.management.getAll)return[];return(await new Promise(e=>{chrome.management.getAll(e)})||[]).filter(e=>{let t;return e.id!==chrome.runtime.id&&"igcijhgmihmjbbahdabahfbpffalcfnn"!==e.id&&"development"===e.installType&&"theme"!==e.type&&!0===e.enabled&&!((t=String(e.name||"").toLowerCase()).includes("extension.js built-in developer tools")||t.includes("extension.js theme"))})}catch{return[]}}async function b(){let e=await x();return e[e.length-1]}!function(e,t=document.documentElement){"dark"===(e??function(){let e=function(){try{let e=localStorage.getItem("theme");if("light"===e||"dark"===e)return e}catch{}return null}();if(e)return e;if("u">typeof window&&"matchMedia"in window)try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{}return"light"}())?t.classList.add("dark"):t.classList.remove("dark")}("dark");let y="firefox"===String("firefox").toLowerCase(),v="My Extension",w="Extension.js makes cross‑browser extension development simple.";function _(e,t,n){let r=document.createElement(e);return t&&(r.className=t),void 0!==n&&(r.textContent=n),r}function E(e){let t=_("a",e);return t.href="https://extension.js.org/",t.target="_blank",t.rel="noopener noreferrer",t}async function j(){let e=await b();if(e)return e;let t=(await new Promise(e=>{try{chrome.management.getAll(e)}catch{e([])}})||[]).filter(e=>e&&"development"===e.installType&&e.id!==chrome.runtime.id&&e.enabled&&"theme"!==e.type),n=t.length?t[t.length-1]:void 0;if(n)return n;let r=chrome.runtime.getManifest();return{id:chrome.runtime.id,name:r?.name||"Extension",shortName:r?.short_name,description:r?.description||"",version:r?.version||"",enabled:!0,installType:"development"}}let T=document.getElementById("root");T&&(e=_("div","relative flex h-screen flex-col items-center justify-center bg-[#1C1C1E]"),t=_("header","mb-4 flex w-full items-center justify-center"),(n=_("img","size-16 select-none object-contain")).alt="User extension icon",n.src=g,r=!1,n.addEventListener("error",()=>{r||(r=!0,n.src=g)}),t.append(n),i=_("h1","text-foreground mx-auto text-center text-3xl font-semibold leading-tight tracking-tight sm:text-4xl"),o=_("span",void 0,v),(a=_("span","neon-text","loaded successfully")).id="extensionName",a.style.color="var(--brand-success, #19f5a7)",i.append(o,_("br"),a),s=_("p","text-muted-foreground mx-auto mt-3 max-w-xl text-center text-base leading-relaxed sm:text-lg",w),e.append(t,i,s,(l=_("div","mt-6 flex w-full items-center justify-center"),c=_("div","relative inline-flex items-center gap-3 rounded-2xl border px-4 py-2 shadow-sm backdrop-blur"),m=_("div","flex flex-wrap items-center gap-3"),(d=E("inline-flex items-center gap-2")).setAttribute("aria-label","Visit extension.js.org"),(u=_("img","size-4 select-none")).alt="Extension.js logo",u.src=g,d.append(u,_("span","sr-only","extension.js")),(p=E("text-muted-foreground text-sm underline underline-offset-4 hover:opacity-90")).textContent="Learn more about developing cross-browser extensions.",m.append(d,p),c.append(m),l.append(c),l)),T.replaceChildren(e),j().then(async e=>{o.textContent=e.name||v,a.title=`• Name: ${e.name}
|
|
2
2
|
• ID: ${e.id}
|
|
3
3
|
• Version: ${e.version}`,s.textContent=e.description||w,n.alt=`${e.name||"User extension"} icon`;let t=function(e){if(e.icons&&e.icons.length)return[...e.icons].sort((e,t)=>(t.size||0)-(e.size||0))[0]?.url}(e);if(t){if(y&&!t.startsWith("data:")){let e=await new Promise(e=>{try{chrome.runtime.sendMessage({type:"resolve-icon-url",url:t},t=>{e(t?.ok&&"string"==typeof t.dataUrl?t.dataUrl:void 0)})}catch{e(void 0)}});e&&!r&&(n.src=e);return}r||(n.src=t)}}).catch(()=>{}))})();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare function devInjectedPermissions(manifestVersion: unknown): readonly string[];
|
|
2
|
+
export declare function usesGatedPart(api: string, source: string): boolean;
|
|
2
3
|
export declare function partiallyGatedNote(api: string): string;
|
|
3
|
-
export declare function partiallyGatedWarning(api: string, relative: string): string | null;
|
|
4
|
+
export declare function partiallyGatedWarning(api: string, relative: string, declared?: ReadonlySet<string>): string | null;
|
package/dist/rspack-config~0.mjs
CHANGED
|
@@ -10453,16 +10453,28 @@ function devInjectedPermissions(manifestVersion) {
|
|
|
10453
10453
|
return 3 === manifestVersion ? DEV_INJECTED_PERMISSIONS_MV3 : DEV_INJECTED_PERMISSIONS_MV2;
|
|
10454
10454
|
}
|
|
10455
10455
|
const PARTIALLY_GATED_APIS = {
|
|
10456
|
-
tabs:
|
|
10456
|
+
tabs: 'the tab url, title and favIconUrl fields come back empty without it'
|
|
10457
10457
|
};
|
|
10458
|
+
const GATED_USES = {
|
|
10459
|
+
tabs: [
|
|
10460
|
+
/(?<!\b(?:document|meta)\s*)\.\s*(?:url|pendingUrl|title|favIconUrl)\b/,
|
|
10461
|
+
/\{[^{}:]*\b(?:url|pendingUrl|title|favIconUrl)\b[^{}:]*\}\s*(?:=|\))/,
|
|
10462
|
+
/\btabs\s*\.\s*query\s*\(\s*\{[^{}]*\b(?:url|title)\s*:/
|
|
10463
|
+
]
|
|
10464
|
+
};
|
|
10465
|
+
function usesGatedPart(api, source) {
|
|
10466
|
+
const patterns = GATED_USES[api];
|
|
10467
|
+
return !patterns || patterns.some((pattern)=>pattern.test(source));
|
|
10468
|
+
}
|
|
10458
10469
|
function partiallyGatedNote(api) {
|
|
10459
10470
|
const note = PARTIALLY_GATED_APIS[api];
|
|
10460
10471
|
return note ? ` Only part of the namespace is gated: ${note}.` : '';
|
|
10461
10472
|
}
|
|
10462
|
-
function partiallyGatedWarning(api, relative) {
|
|
10473
|
+
function partiallyGatedWarning(api, relative, declared = new Set()) {
|
|
10463
10474
|
const note = PARTIALLY_GATED_APIS[api];
|
|
10464
10475
|
if (!note) return null;
|
|
10465
|
-
|
|
10476
|
+
const activeTab = declared.has('activeTab') ? ' activeTab covers only the tab the user invoked the extension on.' : '';
|
|
10477
|
+
return `manifest.json does not declare the "${api}" permission, but ${relative} reads fields it gates. It works in dev only because dev injects "${api}": packaged, ${note}.${activeTab} Add "${api}" to permissions in manifest.json.`;
|
|
10466
10478
|
}
|
|
10467
10479
|
const EMITTED_SCRIPT_RE = /\.[cm]?js$/;
|
|
10468
10480
|
const MAX_SOURCE_BYTES = 1048576;
|
|
@@ -10787,6 +10799,7 @@ function findInjectedOnlyPermissionUses(compilation, declared, injected) {
|
|
|
10787
10799
|
if (firstOffenderByApi.has(api)) continue;
|
|
10788
10800
|
const useRe = new RegExp(`\\b(?:chrome|browser)\\s*\\.\\s*${api}\\b`);
|
|
10789
10801
|
if (!useRe.test(source)) continue;
|
|
10802
|
+
if (!usesGatedPart(api, source)) continue;
|
|
10790
10803
|
const files = emittedFilesOf(compilation, outer);
|
|
10791
10804
|
if (!files || files.some((file)=>{
|
|
10792
10805
|
const text = shippedText(file);
|
|
@@ -10880,7 +10893,7 @@ class ApplyDevDefaults {
|
|
|
10880
10893
|
const uses = findInjectedOnlyPermissionUses(compilation, declared, injectedPermissions);
|
|
10881
10894
|
for (const [api, file] of uses){
|
|
10882
10895
|
const relative = __rspack_external_node_path_806ed179.relative(__rspack_external_node_path_806ed179.dirname(this.manifestPath), file);
|
|
10883
|
-
const text = optionalPermissions.has(api) ? `manifest.json only lists the "${api}" permission under optional_permissions, but ${relative} uses chrome.${api}. It works in development only because the dev instrumentation injects "${api}" as required: the production build has it only after a runtime chrome.permissions.request, so guard the use or move "${api}" to permissions.` : partiallyGatedWarning(api, relative) || `manifest.json does not declare the "${api}" permission, but ${relative} uses chrome.${api}. It works in development only because the dev instrumentation injects "${api}": the production build will fail at runtime. Add "${api}" to permissions in manifest.json.`;
|
|
10896
|
+
const text = optionalPermissions.has(api) ? `manifest.json only lists the "${api}" permission under optional_permissions, but ${relative} uses chrome.${api}. It works in development only because the dev instrumentation injects "${api}" as required: the production build has it only after a runtime chrome.permissions.request, so guard the use or move "${api}" to permissions.` : partiallyGatedWarning(api, relative, declared) || `manifest.json does not declare the "${api}" permission, but ${relative} uses chrome.${api}. It works in development only because the dev instrumentation injects "${api}": the production build will fail at runtime. Add "${api}" to permissions in manifest.json.`;
|
|
10884
10897
|
pushDevWarning('DevInjectedPermissionWarning', optionalPermissions.has(api) ? text + partiallyGatedNote(api) : text);
|
|
10885
10898
|
}
|
|
10886
10899
|
} catch {}
|
package/package.json
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"runtime"
|
|
44
44
|
],
|
|
45
45
|
"name": "extension-develop",
|
|
46
|
-
"version": "4.1.
|
|
46
|
+
"version": "4.1.24",
|
|
47
47
|
"description": "Develop, build, preview, and package Extension.js projects.",
|
|
48
48
|
"author": {
|
|
49
49
|
"name": "Cezar Augusto",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"dependencies": {
|
|
94
94
|
"@prefresh/core": "1.5.9",
|
|
95
95
|
"@prefresh/utils": "1.2.1",
|
|
96
|
-
"@rspack/core": "
|
|
96
|
+
"@rspack/core": "2.2.3",
|
|
97
97
|
"@rspack/dev-server": "2.1.0",
|
|
98
98
|
"@rspack/plugin-preact-refresh": "2.0.1",
|
|
99
99
|
"@rspack/plugin-react-refresh": "2.0.2",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|