extension-develop 2.0.0-rc.25 → 2.0.0-rc.26

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.
@@ -1,14 +0,0 @@
1
- /*! *****************************************************************************
2
- Copyright (c) Microsoft Corporation. All rights reserved.
3
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
- this file except in compliance with the License. You may obtain a copy of the
5
- License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
- MERCHANTABLITY OR NON-INFRINGEMENT.
11
-
12
- See the Apache Version 2.0 License for specific language governing permissions
13
- and limitations under the License.
14
- ***************************************************************************** */
@@ -1,34 +0,0 @@
1
- "use strict";var y=Object.create;var i=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var T=(e,n)=>{for(var r in n)i(e,r,{get:n[r],enumerable:!0})},l=(e,n,r,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of b(n))!v.call(e,o)&&o!==r&&i(e,o,{get:()=>n[o],enumerable:!(s=E(n,o))||s.enumerable});return e};var a=(e,n,r)=>(r=e!=null?y(w(e)):{},l(n||!e||!e.__esModule?i(r,"default",{value:e,enumerable:!0}):r,e)),S=e=>l(i({},"__esModule",{value:!0}),e);var k={};T(k,{default:()=>I});module.exports=S(k);var c=a(require("path")),f=require("loader-utils"),m=require("schema-utils");var F=a(require("path")),t=require("@colors/colors/safe");var d=a(require("path")),O=d.default.join(process.cwd(),"node_modules/extension-develop/dist/certs"),N=["chrome","edge"],R=["firefox"],U=[...N,...R];var M=require("console");function j(e,n){return n==="error"?`${(0,t.bold)((0,t.red)("ERROR"))} in ${e} ${(0,t.red)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`:n==="warn"?`${e} ${(0,t.brightYellow)("\u2716\uFE0E\u2716\uFE0E\u2716\uFE0E")}`:`${n==="info"?(0,t.cyan)("\u25BA\u25BA\u25BA"):(0,t.brightGreen)("\u25BA\u25BA\u25BA")} ${(0,t.cyan)(e)}`}function p(){return`${j("DEPRECATION","warn")} Using ${(0,t.brightYellow)("window.__EXTENSION_SHADOW_ROOT__")} in content_scripts is deprecated
2
- and will be removed in a future version of Extension.js. To use content_scripts with
3
- the shadow DOM, see one of the many examples at:
4
- https://github.com/extension-js/extension.js/tree/main/examples
5
-
6
- If you really need to use the shadow DOM as-is, the latest version of Extension.js
7
- to support it is extension@2.0.0-beta.9.
8
- `}var D={type:"object",properties:{test:{type:"string"},manifestPath:{type:"string"}}};function I(e){let n=this.getOptions(),r=n.manifestPath,s=c.default.dirname(r),o=require(r);(0,m.validate)(D,n,{name:"scripts:deprecated-shadow-root",baseDataPath:"options"});let $=(0,f.urlToRequest)(this.resourcePath),h=`
9
- ;const appendStyleElementForLegacyShadowRoot = (legacyShadowRoot, stylesheets) => {
10
- const styleElement = document.createElement('link')
11
- styleElement.rel = 'stylesheet'
12
- styleElement.href = (typeof chrome !== 'undefined' ? chrome : browser).runtime.getURL('content_scripts/content-0.css')
13
- legacyShadowRoot.appendChild(styleElement)
14
- }
15
-
16
- function injectStyles() {
17
- const legacyShadowRoot = window.__EXTENSION_SHADOW_ROOT__
18
-
19
- if (legacyShadowRoot) {
20
- appendStyleElementForLegacyShadowRoot(legacyShadowRoot)
21
- } else {
22
- // Use MutationObserver to wait for shadow root to be available
23
- const observer = new MutationObserver(() => {
24
- const shadowRoot = window.__EXTENSION_SHADOW_ROOT__
25
-
26
- if (shadowRoot) {
27
- appendStyleElementForLegacyShadowRoot(shadowRoot)
28
- observer.disconnect()
29
- }
30
- })
31
-
32
- observer.observe(document.body, { childList: true, subtree: true })
33
- }
34
- };injectStyles();`;if(o.content_scripts){for(let u of o.content_scripts)if(u.js)for(let g of u.js){let x=c.default.resolve(s,g);if($.includes(x))return e.includes("__EXTENSION_SHADOW_ROOT__")?(console.warn(p()),`${h}${e}`):`${e}`}}return e}
package/dist/dirname.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function getDirname(importMetaUrl: string): string;
@@ -1,10 +0,0 @@
1
- "use strict";var _=Object.create;var m=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var L=(e,n)=>{for(var r in n)m(e,r,{get:n[r],enumerable:!0})},y=(e,n,r,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of D(n))!C.call(e,t)&&t!==r&&m(e,t,{get:()=>n[t],enumerable:!(i=I(n,t))||i.enumerable});return e};var a=(e,n,r)=>(r=e!=null?_(R(e)):{},y(n||!e||!e.__esModule?m(r,"default",{value:e,enumerable:!0}):r,e)),A=e=>y(m({},"__esModule",{value:!0}),e);var X={};L(X,{default:()=>T});module.exports=A(X);var x=a(require("path")),S=require("loader-utils"),M=require("schema-utils");var g=a(require("path")),z=a(require("fs")),B=require("child_process"),J=require("package-manager-detector");var W=a(require("path")),o=require("@colors/colors/safe");var v=a(require("path")),U=v.default.join(process.cwd(),"node_modules/extension-develop/dist/certs"),b=["chrome","edge"],P=["firefox"],Z=[...b,...P];var H=require("console");function E(e){return e.replace(/\\/g,"/")}function h(e,n={}){if(!n)return!1;let r=g.default.normalize(E(e));return Object.values(n).some(t=>typeof t!="string"?!1:E(t).includes(r))}function F(e,n){let r=g.default.relative(g.default.dirname(e),n);return!r.startsWith(".")&&!r.startsWith("..")&&(r="./"+r),r}var $=a(require("fs")),j=a(require("path"));function N(e,n){return(Array.isArray(e)?e||[]:e?[e]:[]).filter(t=>{let l=$.default.existsSync(t)&&!h(t,n),s=j.default.extname(t);return l&&(s===".js"||s===".mjs"||s===".jsx"||s===".ts"||s===".tsx")})}function w(e,n){return(Array.isArray(e)?e||[]:e?[e]:[]).filter(t=>$.default.existsSync(t)&&!h(t,n)&&(t.endsWith(".css")||t.endsWith(".scss")||t.endsWith(".sass")||t.endsWith(".less")))}var G={type:"object",properties:{test:{type:"string"},manifestPath:{type:"string"},includeList:{type:"object"},excludeList:{type:"object"}}},K=`/**
2
- * Welcome to to your content_scripts CSS file during development!
3
- * To speed up the development process, your styles
4
- * are being injected directly into the head of the webpage,
5
- * and will be removed when you build your application, along
6
- * with this file. If you are seeing this file in a production build,
7
- * it means that something is wrong with your build configuration.
8
- */`;function T(e){let n=this.getOptions();(0,M.validate)(G,n,{name:"scripts:inject-content-css-during-dev",baseDataPath:"options"});let r=n.includeList||{},i=[],t=Object.entries(r).filter(([s,u])=>s.startsWith("content")&&u);if(!t.length)return e;for(let s of t){let[u,d]=s,c=[...N(d,n.excludeList||{})],p=w(d,n.excludeList||{});if(p.length&&!c.length){let f=x.default.resolve(__dirname,"minimum-content-file.mjs");c.push(f)}i.push({feature:u,scriptPath:c[0],cssImports:p.map(f=>F(c[0],f))})}let l=(0,S.urlToRequest)(this.resourcePath);return i.forEach(({feature:s,scriptPath:u,cssImports:d})=>{if(l.includes(u)){let c=d.map(p=>{let[,f]=s.split("/"),O=f.split("-")[1],k=x.default.basename(p);return`import(/* webpackChunkName: "${`web_accessible_resources/resource-${O}/${k.replace(".","_")}`}" */ '${p}').then(css => console.info('content_script.css loaded', css)).catch(err => console.error(err));`}).join(`
9
- `);this.emitFile(`${s}.css`,K),e=`${c}
10
- ${e}`}}),e}
@@ -1 +0,0 @@
1
- chrome.runtime.onMessageExternal.addListener(async(e,r,a)=>{let n=await new Promise(i=>{chrome.management.getSelf(i)});return e.initialLoadData?(a({id:chrome.runtime.id,manifest:chrome.runtime.getManifest(),management:n}),!0):((e.changedFile==="declarative_net_request"||e.changedFile==="manifest.json"||e.changedFile==="service_worker"||e.changedFile==="_locales")&&(a({reloaded:!0}),chrome.runtime.reload()),!0)});
@@ -1 +0,0 @@
1
- import.meta.webpackHot&&import.meta.webpackHot.accept();
@@ -1 +0,0 @@
1
- browser.runtime.onMessageExternal.addListener(async(e,a)=>{let n=await browser.management.getSelf();return e.initialLoadData?{id:browser.runtime.id,manifest:browser.runtime.getManifest(),management:n}:((e.changedFile==="declarative_net_request"||e.changedFile==="manifest.json"||e.changedFile==="service_worker"||e.changedFile==="_locales")&&browser.runtime.reload(),{reloaded:!0})});
File without changes