extension-develop 2.0.0-beta.9 → 2.0.0-rc.1
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/add-hmr-accept-code.js +4 -3
- package/dist/depreacated-shadow-root.js +34 -0
- package/dist/deprecated-shadow-root.js +34 -0
- package/dist/ensure-hmr-for-scripts.js +2 -2
- package/dist/inject-chromium-client-loader.js +2 -2
- package/dist/inject-firefox-client-loader.js +3 -3
- package/dist/module.d.ts +2 -2
- package/dist/module.js +66 -104
- package/dist/resolver-loader.js +1 -1
- package/package.json +12 -19
- package/dist/extensions/safari-manager-extension/background.js +0 -58
- package/dist/extensions/safari-manager-extension/define-initial-tab.js +0 -67
- package/dist/extensions/safari-manager-extension/images/logo.png +0 -0
- package/dist/extensions/safari-manager-extension/manifest.json +0 -17
- package/dist/extensions/safari-manager-extension/pages/sakura-dark.css +0 -268
- package/dist/extensions/safari-manager-extension/pages/sakura.css +0 -267
- package/dist/extensions/safari-manager-extension/pages/welcome.html +0 -49
- package/dist/extensions/safari-manager-extension/pages/welcome.js +0 -34
- package/dist/extensions/safari-manager-extension/reload-service.js +0 -145
- package/dist/extensions/webkit-based-manager-extension/background.js +0 -58
- package/dist/extensions/webkit-based-manager-extension/define-initial-tab.js +0 -67
- package/dist/extensions/webkit-based-manager-extension/images/logo.png +0 -0
- package/dist/extensions/webkit-based-manager-extension/manifest.json +0 -17
- package/dist/extensions/webkit-based-manager-extension/pages/sakura-dark.css +0 -268
- package/dist/extensions/webkit-based-manager-extension/pages/sakura.css +0 -267
- package/dist/extensions/webkit-based-manager-extension/pages/welcome.html +0 -49
- package/dist/extensions/webkit-based-manager-extension/pages/welcome.js +0 -34
- package/dist/extensions/webkit-based-manager-extension/reload-service.js +0 -145
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/2f9e674f13c5ee43_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/37efc878b9e2e181_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/4687d168a80cb2c2_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/4ed8c6191e06df7e_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/516b8adbcaf9e7ef_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/54fe1cc8a6aa782e_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/598e6a77ceb3d616_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/623afcba6dc2b340_0 +0 -0
- package/dist/run-chrome-profile/Default/Cache/Cache_Data/bc26ddd2d404d9c4_0 +0 -0
- package/dist/run-chrome-profile/Default/Network Persistent State +0 -1
- package/dist/run-chrome-profile/Default/Service Worker/ScriptCache/index-dir/the-real-index +0 -0
package/dist/resolver-loader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var V=Object.create;var g=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var Q=(e,t)=>{for(var r in t)g(e,r,{get:t[r],enumerable:!0})},y=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of K(t))!Y.call(e,o)&&o!==r&&g(e,o,{get:()=>t[o],enumerable:!(n=G(t,o))||n.enumerable});return e};var l=(e,t,r)=>(r=e!=null?V(X(e)):{},y(t||!e||!e.__esModule?g(r,"default",{value:e,enumerable:!0}):r,e)),Z=e=>y(g({},"__esModule",{value:!0}),e);var he={};Q(he,{default:()=>J});module.exports=Z(he);var m=l(require("path")),z=require("schema-utils");var v=require("@swc/core"),_=require("acorn"),P=l(require("acorn-walk")),M=require("astring");function ee(e,t){let r=e;for(let n=t.length-1;n>=0;n--){if(n===0)return r.type==="Identifier"&&r.name===t[n];if(r.type!=="MemberExpression"||r.property.type!=="Identifier"||r.property.name!==t[n])return!1;r=r.object}return!0}function s(e,t){let r=t.split(".");return ee(e,r)}function u(e,t){if(e.arguments.length===0)return;let r=e.arguments[0];e.arguments[0]={type:"CallExpression",callee:{type:"Identifier",name:t},arguments:[r]}}function h(e,t){if(e.arguments.length!==0){if(t==="chrome.devtools.panels.create"||t==="browser.devtools.panels.create")e.arguments[1]={type:"CallExpression",callee:{type:"Identifier",name:"r.solve"},arguments:[e.arguments[1]]},e.arguments[2]={type:"CallExpression",callee:{type:"Identifier",name:"r.solve"},arguments:[e.arguments[2]]};else if(t==="chrome.runtime.getURL"||t==="browser.runtime.getURL"){if(e.arguments[0].type==="Literal"&&e.arguments[0].value.includes("/_favicon/"))return;e.arguments[0]={type:"CallExpression",callee:{type:"Identifier",name:"r.solve"},arguments:[e.arguments[0]]}}}}function te(e,t,r,n){(s(e,`${n}.action.setIcon`)||s(e,`${n}.browserAction.setIcon`)||s(e,`${n}.pageAction.setIcon`)||s(e,`${n}.declarativeContent.SetIcon`)||s(e,`${n}.action.setPopup`)||s(e,`${n}.browserAction.setPopup`)||s(e,`${n}.pageAction.setPopup`)||s(e,`${n}.scriptBadge.setPopup`))&&u(r,"r.solve"),s(e,`${n}.devtools.panels.create`)&&h(r,`${n}.devtools.panels.create`),s(e,`${n}.downloads.download`)&&u(r,"r.solve"),s(e,`${n}.runtime.getURL`)&&h(r,`${n}.runtime.getURL`),(s(e,`${n}.scripting.insertCSS`)||s(e,`${n}.scripting.removeCSS`)||s(e,`${n}.scripting.executeScript`))&&u(r,"r.solve"),(s(e,`${n}.scripting.registerContentScripts`)||s(e,`${n}.declarativeContent.RequestContentScript`))&&u(r,"r.solve"),s(e,`${n}.declarativeContent.RequestContentScript`)&&u(r,"r.solve"),(s(e,`${n}.tabs.create`)||s(e,`${n}.tabs.executeScript`)||s(e,`${n}.tabs.insertCSS`)||s(e,`${n}.windows.create`))&&t.length>0&&u(r,"r.solve"),s(e,`${n}.sidePanel.setOptions`)&&u(r,"r.solve"),s(e,`${n}.notifications.create`)&&u(r,"r.solve")}function
|
|
1
|
+
"use strict";var V=Object.create;var g=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var Q=(e,t)=>{for(var r in t)g(e,r,{get:t[r],enumerable:!0})},y=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of K(t))!Y.call(e,o)&&o!==r&&g(e,o,{get:()=>t[o],enumerable:!(n=G(t,o))||n.enumerable});return e};var l=(e,t,r)=>(r=e!=null?V(X(e)):{},y(t||!e||!e.__esModule?g(r,"default",{value:e,enumerable:!0}):r,e)),Z=e=>y(g({},"__esModule",{value:!0}),e);var he={};Q(he,{default:()=>J});module.exports=Z(he);var m=l(require("path")),z=require("schema-utils");var v=require("@swc/core"),_=require("acorn"),P=l(require("acorn-walk")),M=require("astring");function ee(e,t){let r=e;for(let n=t.length-1;n>=0;n--){if(n===0)return r.type==="Identifier"&&r.name===t[n];if(r.type!=="MemberExpression"||r.property.type!=="Identifier"||r.property.name!==t[n])return!1;r=r.object}return!0}function s(e,t){let r=t.split(".");return ee(e,r)}function u(e,t){if(e.arguments.length===0)return;let r=e.arguments[0];e.arguments[0]={type:"CallExpression",callee:{type:"Identifier",name:t},arguments:[r]}}function h(e,t){if(e.arguments.length!==0){if(t==="chrome.devtools.panels.create"||t==="browser.devtools.panels.create")e.arguments[1]={type:"CallExpression",callee:{type:"Identifier",name:"r.solve"},arguments:[e.arguments[1]]},e.arguments[2]={type:"CallExpression",callee:{type:"Identifier",name:"r.solve"},arguments:[e.arguments[2]]};else if(t==="chrome.runtime.getURL"||t==="browser.runtime.getURL"){if(e.arguments[0].type==="Literal"&&e.arguments[0].value.includes("/_favicon/"))return;e.arguments[0]={type:"CallExpression",callee:{type:"Identifier",name:"r.solve"},arguments:[e.arguments[0]]}}}}function te(e,t,r,n){(s(e,`${n}.action.setIcon`)||s(e,`${n}.browserAction.setIcon`)||s(e,`${n}.pageAction.setIcon`)||s(e,`${n}.declarativeContent.SetIcon`)||s(e,`${n}.action.setPopup`)||s(e,`${n}.browserAction.setPopup`)||s(e,`${n}.pageAction.setPopup`)||s(e,`${n}.scriptBadge.setPopup`))&&u(r,"r.solve"),s(e,`${n}.devtools.panels.create`)&&h(r,`${n}.devtools.panels.create`),s(e,`${n}.downloads.download`)&&u(r,"r.solve"),s(e,`${n}.runtime.getURL`)&&h(r,`${n}.runtime.getURL`),(s(e,`${n}.scripting.insertCSS`)||s(e,`${n}.scripting.removeCSS`)||s(e,`${n}.scripting.executeScript`))&&u(r,"r.solve"),(s(e,`${n}.scripting.registerContentScripts`)||s(e,`${n}.declarativeContent.RequestContentScript`))&&u(r,"r.solve"),s(e,`${n}.declarativeContent.RequestContentScript`)&&u(r,"r.solve"),(s(e,`${n}.tabs.create`)||s(e,`${n}.tabs.executeScript`)||s(e,`${n}.tabs.insertCSS`)||s(e,`${n}.windows.create`))&&t.length>0&&u(r,"r.solve"),s(e,`${n}.sidePanel.setOptions`)&&u(r,"r.solve"),s(e,`${n}.notifications.create`)&&u(r,"r.solve")}function E(e,t){let r=(0,v.transformSync)(e,{module:{type:"es6"},minify:t.minify,jsc:{loose:!0,target:"es2016",externalHelpers:!0,parser:{syntax:t.typescript?"typescript":"ecmascript",jsx:!t.typescript&&t.jsx,tsx:t.typescript&&t.jsx,dynamicImport:!0},transform:{react:{runtime:"automatic",importSource:"react"}}}}),n=(0,_.parse)(r.code,{sourceType:"module",ecmaVersion:"latest"});return P.simple(n,{CallExpression(i){let a=["chrome","browser"],c=i.callee,d=i.arguments;a.forEach(f=>{te(c,d,i,f)})}}),(0,M.generate)(n)}var b=l(require("fs"));var x=l(require("path"));function S(e){if(!e||!e.background)return;let t=e.background.scripts;if(t)return t.map(r=>r)}function w(e){if(!e||!e.background)return;if(e.background.service_worker)return e.background.service_worker}function D(e){if(!e||!e.content_scripts)return{"content_scripts/content-0.js":void 0};let t=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)},n={},o=e.content_scripts;for(let[i,a]of o.entries()){let c=t(a),d=r(a);n[`content_scripts/content-${i}`]=[...(c||[]).filter(f=>f!=null),...(d||[]).filter(f=>f!=null)]}return n}function j(e){return!e||!e.user_scripts||!e.user_scripts.api_script?void 0:e.user_scripts.api_script}function k(e){return!e||!e.action||!e.action.default_popup?void 0:e.action.default_popup}function A(e){return!e||!e.background||!e.background.page?void 0:e.background.page}function F(e){return!e||!e.browser_action||!e.browser_action.default_popup?void 0:e.browser_action.default_popup}function O(e){let t={newtab:void 0};return!e||!e.chrome_url_overrides?{"chrome_url_overrides/newtab.html":void 0}:(e.chrome_url_overrides.history&&(t={"chrome_url_overrides/history.html":e.chrome_url_overrides.history}),e.chrome_url_overrides.newtab&&(t={"chrome_url_overrides/newtab.html":e.chrome_url_overrides.newtab}),e.chrome_url_overrides.bookmarks&&(t={"chrome_url_overrides/bookmarks.html":e.chrome_url_overrides.bookmarks}),t)}function R(e){return!e||!e.devtools_page?void 0:e.devtools_page}function I(e){return e.options_page?e.options_page:!e||!e.options_ui||!e.options_ui.page?void 0:e.options_ui.page}function N(e){return!e||!e.page_action||!e.page_action.default_popup?void 0:e.page_action.default_popup}function T(e){if(!e||!e.sandbox||!e.sandbox.pages)return{"sandbox/page-0.html":void 0};let t=e.sandbox.pages,r={};for(let[n,o]of t.entries()){let i=o;r[`sandbox/page-${n}.html`]=i}return r}function C(e){return!e||!e.side_panel||!e.side_panel.default_path?void 0:e.side_panel.default_path}function L(e){return!e||!e.sidebar_action||!e.sidebar_action.default_panel?void 0:e.sidebar_action.default_panel}function U(e){return{"background/scripts.js":S(e),"background/service_worker.js":w(e),...D(e),"user_scripts/apiscript.js":j(e),"action/default_popup.html":k(e),"background/page.html":A(e),"browser_action/default_popup.html":F(e),...O(e),"devtools_page.html":R(e),"options_ui/page.html":I(e),"page_action/default_popup.html":N(e),...T(e),"side_panel/default_path.html":C(e),"sidebar_action/default_panel.html":L(e)}}var ae=l(require("path")),ce=l(require("fs")),ue=require("child_process"),pe=require("package-manager-detector");var oe=l(require("path")),p=require("@colors/colors/safe");var W=l(require("path")),re=W.default.join(process.cwd(),"node_modules/extension-develop/dist/certs"),$=["chrome","edge"],ne=["firefox"],et=[...$,...ne];var se=require("console");function H(e,t){return JSON.parse(JSON.stringify(e),function(o,i){let a=o.indexOf(":");if(a===-1)return i;let c=o.substring(0,a);(c===t||c==="chromium"&&$.includes(t)||c==="chromium"&&t.includes("chromium")||c==="gecko"&&t.includes("gecko"))&&(this[o.substring(a+1)]=i)})}function de(e,t){let r=x.default.dirname(e);return Object.entries(t||{}).reduce((o,[i,a])=>{let c=x.default.relative(r,a);return o[i]=c,o},{})}function fe(e,t){let r=require(e),n=H(r,t);return U(n)}function q(e,t,r){let n=de(e,r),o=fe(e,t);return{...n,...o}}function B(e,t){let r=e.getOptions(),{manifestPath:n,includeList:o,browser:i}=r,a=JSON.stringify(q(n,i,o)),d=b.default.readFileSync(t,"utf8").replace('"__RESOLVER_MODULE_FILE_LIST__"',`${a}`);b.default.writeFileSync(t,d)}var ge={type:"object",properties:{test:{type:"string"},browser:{type:"string"},manifestPath:{type:"string"},includeList:{type:"object"},excludeList:{type:"object"},loaderOptions:{type:"object"}}};function me(e,t){if(!e.content_scripts)return[];let r=[];return e.content_scripts.forEach(n=>{n.js&&n.js.forEach(o=>{r.push(m.default.resolve(t,o))})}),r}function J(e){let t=this.getOptions();if((0,z.validate)(ge,t,{name:"resolve:loader",baseDataPath:"options"}),new RegExp(t.test).test(this.resourcePath)){let r="resolver-module.mjs";if(this.resourcePath.includes("node_modules")||this.resourcePath.includes("dist/"))return e;let n=m.default.dirname(t.manifestPath);if(me(require(t.manifestPath),n).some(c=>c===this.resourcePath))return e;let i=E(e,t),a=m.default.join(__dirname,r);return B(this,a),i}return e}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"node": ">=18"
|
|
10
10
|
},
|
|
11
11
|
"name": "extension-develop",
|
|
12
|
-
"version": "2.0.0-
|
|
12
|
+
"version": "2.0.0-rc.1",
|
|
13
13
|
"description": "The develop step of Extension.js",
|
|
14
14
|
"main": "./dist/module.js",
|
|
15
15
|
"types": "./dist/module.d.ts",
|
|
@@ -23,20 +23,19 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@colors/colors": "^1.6.0",
|
|
26
|
+
"@rspack/core": "^1.2.8",
|
|
27
|
+
"@rspack/dev-server": "^1.1.0",
|
|
26
28
|
"@swc/core": "^1.10.1",
|
|
29
|
+
"@swc/helpers": "^0.5.15",
|
|
27
30
|
"@types/firefox-webext-browser": "^120.0.4",
|
|
28
|
-
"
|
|
29
|
-
"acorn-walk": "^8.3.4",
|
|
31
|
+
"@vue/compiler-sfc": "^3.5.13",
|
|
30
32
|
"adm-zip": "^0.5.16",
|
|
31
|
-
"ajv": "^8.17.1",
|
|
32
|
-
"astring": "^1.9.0",
|
|
33
33
|
"axios": "^1.7.9",
|
|
34
34
|
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|
|
35
35
|
"chokidar": "^4.0.1",
|
|
36
36
|
"chrome-location": "^1.2.1",
|
|
37
37
|
"content-security-policy-parser": "^0.6.0",
|
|
38
38
|
"cross-spawn": "^7.0.6",
|
|
39
|
-
"css-loader": "^6.10.0",
|
|
40
39
|
"csv-loader": "^3.0.5",
|
|
41
40
|
"dotenv": "^16.4.7",
|
|
42
41
|
"dotenv-webpack": "^8.1.0",
|
|
@@ -47,24 +46,19 @@
|
|
|
47
46
|
"ignore": "^6.0.2",
|
|
48
47
|
"loader-utils": "^3.3.1",
|
|
49
48
|
"micromatch": "^4.0.8",
|
|
50
|
-
"mini-css-extract-plugin": "^2.9.2",
|
|
51
49
|
"package-manager-detector": "^0.2.7",
|
|
52
50
|
"parse5": "^7.2.1",
|
|
53
51
|
"parse5-utils": "^2.0.0",
|
|
54
52
|
"postcss": "^8.4.49",
|
|
53
|
+
"preact": "^10.22.0",
|
|
55
54
|
"progress": "^2.0.3",
|
|
56
55
|
"schema-utils": "^4.2.0",
|
|
57
56
|
"slugify": "^1.6.6",
|
|
58
|
-
"style-loader": "^3.3.4",
|
|
59
|
-
"swc-loader": "^0.2.6",
|
|
60
57
|
"tiny-glob": "^0.2.9",
|
|
61
|
-
"tsconfig-paths-webpack-plugin": "^4.2.0",
|
|
62
58
|
"vue-template-compiler": "^2.7.16",
|
|
63
59
|
"webextension-polyfill": "^0.12.0",
|
|
64
|
-
"webpack": "~5.97.1",
|
|
65
|
-
"webpack-dev-server": "^5.1.0",
|
|
66
60
|
"webpack-merge": "^6.0.1",
|
|
67
|
-
"webpack-target-webextension": "^2.
|
|
61
|
+
"webpack-target-webextension": "^2.1.3",
|
|
68
62
|
"which": "^5.0.0",
|
|
69
63
|
"ws": "^8.18.0"
|
|
70
64
|
},
|
|
@@ -85,17 +79,16 @@
|
|
|
85
79
|
"typescript": "5.7.2"
|
|
86
80
|
},
|
|
87
81
|
"optionalDependencies": {
|
|
88
|
-
"@
|
|
82
|
+
"@prefresh/core": "^1.5.2",
|
|
83
|
+
"@prefresh/utils": "^1.2.0",
|
|
89
84
|
"@prefresh/webpack": "^4.0.1",
|
|
85
|
+
"@rspack/plugin-preact-refresh": "^1.1.2",
|
|
86
|
+
"@rspack/plugin-react-refresh": "^1.0.1",
|
|
90
87
|
"babel-loader": "^9.2.1",
|
|
91
88
|
"less-loader": "^12.2.0",
|
|
92
|
-
"postcss-flexbugs-fixes": "^5.0.2",
|
|
93
89
|
"postcss-loader": "^8.1.1",
|
|
94
|
-
"postcss-normalize": "^13.0.1",
|
|
95
90
|
"postcss-preset-env": "^10.1.1",
|
|
96
|
-
"postcss-scss": "^4.0.9",
|
|
97
91
|
"react-refresh": "^0.14.2",
|
|
98
|
-
"react-refresh-typescript": "^2.0.9",
|
|
99
92
|
"resolve-url-loader": "^5.0.0",
|
|
100
93
|
"sass-loader": "^16.0.4",
|
|
101
94
|
"svelte-loader": "^3.2.4",
|
|
@@ -110,6 +103,6 @@
|
|
|
110
103
|
"compile": "tsup-node ./module.ts --format cjs --dts --target=node18 --minify && bash install_scripts.sh",
|
|
111
104
|
"test": "jest --no-cache --testPathPattern='webpack/.*/__spec__/.*\\.spec\\.*'",
|
|
112
105
|
"test:coverage": "jest --no-cache --testPathPattern='webpack/.*/__spec__/.*\\.spec\\.ts' --coverage",
|
|
113
|
-
"test:build": "jest ./build.spec.ts --no-cache"
|
|
106
|
+
"test:build": "jest ./build.spec.ts --no-cache --detectOpenHandles --forceExit"
|
|
114
107
|
}
|
|
115
108
|
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import {createExtensionsPageTab, handleFirstRun} from './define-initial-tab.js'
|
|
2
|
-
import {connect, disconnect, keepAlive} from './reload-service.js'
|
|
3
|
-
|
|
4
|
-
function bgGreen(str) {
|
|
5
|
-
return `background: #0A0C10; color: #26FFB8; ${str}`
|
|
6
|
-
}
|
|
7
|
-
chrome.tabs.query({active: true}, async ([initialTab]) => {
|
|
8
|
-
console.log(
|
|
9
|
-
`%c
|
|
10
|
-
██████████████████████████████████████████████████████████
|
|
11
|
-
██████████████████████████████████████████████████████████
|
|
12
|
-
████████████████████████████ ██████████████████████████
|
|
13
|
-
█████████████████████████ ██████ ███████████████
|
|
14
|
-
███████████████████████ ███ ███ ████████████
|
|
15
|
-
██████████████████████ ██████ ███ ███████████
|
|
16
|
-
███████████████████████ ██████ ██████ ███████████
|
|
17
|
-
████████████████ ██████ ██████████████ ███████████
|
|
18
|
-
█████████████ ████ ████████████ ████████████
|
|
19
|
-
███████████ ██ █████████████ ███████████████
|
|
20
|
-
██████████ ██████ █████████████████ █████████████
|
|
21
|
-
███████████ ████████████████████████████ ███████████
|
|
22
|
-
█████████████ █████████████████ ██████ ██████████
|
|
23
|
-
███████████████ ██████████████ ██ ██████████
|
|
24
|
-
████████████ ████████████ ████ █████████████
|
|
25
|
-
███████████ █████████████ ██████ ███████████████
|
|
26
|
-
███████████ ██████ ██████ ███████████████████████
|
|
27
|
-
███████████ ████ ██████ ██████████████████████
|
|
28
|
-
████████████ ██ ███ ███████████████████████
|
|
29
|
-
███████████████ ██████ █████████████████████████
|
|
30
|
-
██████████████████████████ ████████████████████████████
|
|
31
|
-
██████████████████████████████████████████████████████████
|
|
32
|
-
██████████████████████████████████████████████████████████
|
|
33
|
-
MIT (c) ${new Date().getFullYear()} - Cezar Augusto and the Extension.js Authors.
|
|
34
|
-
`,
|
|
35
|
-
bgGreen('')
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
if (
|
|
39
|
-
initialTab.url === 'chrome://newtab/' ||
|
|
40
|
-
initialTab.url === 'chrome://welcome/'
|
|
41
|
-
) {
|
|
42
|
-
await handleFirstRun()
|
|
43
|
-
} else {
|
|
44
|
-
createExtensionsPageTab(initialTab, 'chrome://extensions/')
|
|
45
|
-
}
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
chrome.runtime.onInstalled.addListener(async () => {
|
|
49
|
-
let isConnected = false
|
|
50
|
-
|
|
51
|
-
if (isConnected) {
|
|
52
|
-
disconnect()
|
|
53
|
-
} else {
|
|
54
|
-
await connect()
|
|
55
|
-
isConnected = true
|
|
56
|
-
keepAlive()
|
|
57
|
-
}
|
|
58
|
-
})
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
async function getDevExtension() {
|
|
2
|
-
const allExtensions = await new Promise((resolve) => {
|
|
3
|
-
chrome.management.getAll(resolve)
|
|
4
|
-
})
|
|
5
|
-
|
|
6
|
-
const devExtensions = allExtensions.filter((extension) => {
|
|
7
|
-
return (
|
|
8
|
-
// Do not include itself
|
|
9
|
-
extension.id !== chrome.runtime.id &&
|
|
10
|
-
// Reload extension
|
|
11
|
-
extension.id !== 'igcijhgmihmjbbahdabahfbpffalcfnn' &&
|
|
12
|
-
// Show only unpackaged extensions
|
|
13
|
-
extension.installType === 'development'
|
|
14
|
-
)
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
return devExtensions[0]
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Ideas here are adapted from
|
|
21
|
-
// https://github.com/jeremyben/webpack-chrome-extension-launcher
|
|
22
|
-
// Released under MIT license.
|
|
23
|
-
|
|
24
|
-
// Create a new tab and set it to background.
|
|
25
|
-
// We want the user-selected page to be active,
|
|
26
|
-
// not chrome://extensions.
|
|
27
|
-
export function createExtensionsPageTab(initialTab, url) {
|
|
28
|
-
// Check if url tab is open
|
|
29
|
-
chrome.tabs.query({url: 'chrome://extensions/'}, (tabs) => {
|
|
30
|
-
const extensionsTabExist = tabs.length > 0
|
|
31
|
-
|
|
32
|
-
// Return if url exists
|
|
33
|
-
if (extensionsTabExist) return
|
|
34
|
-
|
|
35
|
-
// Create an inactive tab
|
|
36
|
-
chrome.tabs.create(
|
|
37
|
-
{url, active: false},
|
|
38
|
-
function setBackgroundTab(extensionsTab) {
|
|
39
|
-
// Get current url tab and move it left.
|
|
40
|
-
// This action auto-activates the tab
|
|
41
|
-
chrome.tabs.move(extensionsTab.id, {index: 0}, () => {
|
|
42
|
-
// Get user-selected initial page tab and activate the right tab
|
|
43
|
-
setTimeout(() => {
|
|
44
|
-
chrome.tabs.update(initialTab.id, {active: true})
|
|
45
|
-
}, 500)
|
|
46
|
-
})
|
|
47
|
-
}
|
|
48
|
-
)
|
|
49
|
-
})
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Function to handle first run logic
|
|
53
|
-
export async function handleFirstRun() {
|
|
54
|
-
chrome.tabs.update({url: 'chrome://extensions/'})
|
|
55
|
-
|
|
56
|
-
const devExtension = await getDevExtension()
|
|
57
|
-
|
|
58
|
-
chrome.storage.local.get(devExtension.id, (result) => {
|
|
59
|
-
if (result[devExtension.id] && result[devExtension.id].didRun) {
|
|
60
|
-
return
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
chrome.tabs.create({url: 'pages/welcome.html'})
|
|
64
|
-
// Ensure the welcome page shows only once per extension installation
|
|
65
|
-
chrome.storage.local.set({[devExtension.id]: {didRun: true}})
|
|
66
|
-
})
|
|
67
|
-
}
|
|
Binary file
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "Extension Manager",
|
|
3
|
-
"description": "Extension.js developer tools for tabs and reload management.",
|
|
4
|
-
"version": "1.0",
|
|
5
|
-
"manifest_version": 3,
|
|
6
|
-
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAolEJq/DBHxY5dBpOqBRWNCl7vRPBvJPlpEzF19fYFVzzaH44AF6+sKjN3jwIKlsgI82F3TIuwoNFiN1yBu5Unf8SVBE4BTO92P02/ACcGYQxicgCLFUGQKlq4uSrwSPaBYl7FHcYl5SERgxnIGCGnaGMdL2vC7waCj2/U/iKoBF9I1lBH9/aKCSjTd3h2UYo7gg6n5nY/ENbzylDt42T3ATmvnVJfYhSNKA9Dv/zryknfnHYYgBKHtz7pDZwWnYdxs78n2VEKwGj7TgbXuIPDpCkrMnU9PTKpHbXFYARA4H9qYORQmYazfIxUZRnKQNSR+GAOGrb8JK+ijeQdwzDAwIDAQAB",
|
|
7
|
-
"background": {
|
|
8
|
-
"service_worker": "background.js",
|
|
9
|
-
"type": "module"
|
|
10
|
-
},
|
|
11
|
-
"icons": {
|
|
12
|
-
"16": "images/logo.png",
|
|
13
|
-
"48": "images/logo.png",
|
|
14
|
-
"128": "images/logo.png"
|
|
15
|
-
},
|
|
16
|
-
"permissions": ["management", "tabs", "storage"]
|
|
17
|
-
}
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
/* $color-text: #dedce5; */
|
|
2
|
-
/* Sakura.css v1.5.0
|
|
3
|
-
* ================
|
|
4
|
-
* Minimal css theme.
|
|
5
|
-
* Project: https://github.com/oxalorg/sakura/
|
|
6
|
-
*/
|
|
7
|
-
/* Body */
|
|
8
|
-
html {
|
|
9
|
-
font-size: 62.5%;
|
|
10
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
11
|
-
'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
body {
|
|
15
|
-
font-size: 1.8rem;
|
|
16
|
-
line-height: 1.618;
|
|
17
|
-
max-width: 38em;
|
|
18
|
-
margin: auto;
|
|
19
|
-
color: #c9c9c9;
|
|
20
|
-
background-color: #222222;
|
|
21
|
-
padding: 13px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@media (max-width: 684px) {
|
|
25
|
-
body {
|
|
26
|
-
font-size: 1.53rem;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
@media (max-width: 382px) {
|
|
30
|
-
body {
|
|
31
|
-
font-size: 1.35rem;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
h1,
|
|
35
|
-
h2,
|
|
36
|
-
h3,
|
|
37
|
-
h4,
|
|
38
|
-
h5,
|
|
39
|
-
h6 {
|
|
40
|
-
line-height: 1.1;
|
|
41
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
|
42
|
-
'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
|
|
43
|
-
font-weight: 700;
|
|
44
|
-
margin-top: 3rem;
|
|
45
|
-
margin-bottom: 1.5rem;
|
|
46
|
-
overflow-wrap: break-word;
|
|
47
|
-
word-wrap: break-word;
|
|
48
|
-
-ms-word-break: break-all;
|
|
49
|
-
word-break: break-word;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
h1 {
|
|
53
|
-
font-size: 2.35em;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
h2 {
|
|
57
|
-
font-size: 2em;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
h3 {
|
|
61
|
-
font-size: 1.75em;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
h4 {
|
|
65
|
-
font-size: 1.5em;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
h5 {
|
|
69
|
-
font-size: 1.25em;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
h6 {
|
|
73
|
-
font-size: 1em;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
p {
|
|
77
|
-
margin-top: 0px;
|
|
78
|
-
margin-bottom: 2.5rem;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
small,
|
|
82
|
-
sub,
|
|
83
|
-
sup {
|
|
84
|
-
font-size: 75%;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
hr {
|
|
88
|
-
border-color: #ffffff;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
a {
|
|
92
|
-
text-decoration: none;
|
|
93
|
-
color: #ffffff;
|
|
94
|
-
}
|
|
95
|
-
a:visited {
|
|
96
|
-
color: #e6e6e6;
|
|
97
|
-
}
|
|
98
|
-
a:hover {
|
|
99
|
-
color: #c9c9c9;
|
|
100
|
-
border-bottom: 2px solid #c9c9c9;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
ul {
|
|
104
|
-
padding-left: 1.4em;
|
|
105
|
-
margin-top: 0px;
|
|
106
|
-
margin-bottom: 2.5rem;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
li {
|
|
110
|
-
margin-bottom: 0.4em;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
blockquote {
|
|
114
|
-
margin-left: 0px;
|
|
115
|
-
margin-right: 0px;
|
|
116
|
-
padding-left: 1em;
|
|
117
|
-
padding-top: 0.8em;
|
|
118
|
-
padding-bottom: 0.8em;
|
|
119
|
-
padding-right: 0.8em;
|
|
120
|
-
border-left: 5px solid #ffffff;
|
|
121
|
-
margin-bottom: 2.5rem;
|
|
122
|
-
background-color: #4a4a4a;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
blockquote p {
|
|
126
|
-
margin-bottom: 0;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
img,
|
|
130
|
-
video {
|
|
131
|
-
height: auto;
|
|
132
|
-
max-width: 100%;
|
|
133
|
-
margin-top: 0px;
|
|
134
|
-
margin-bottom: 2.5rem;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/* Pre and Code */
|
|
138
|
-
pre {
|
|
139
|
-
background-color: #4a4a4a;
|
|
140
|
-
display: block;
|
|
141
|
-
padding: 1em;
|
|
142
|
-
overflow-x: auto;
|
|
143
|
-
margin-top: 0px;
|
|
144
|
-
margin-bottom: 2.5rem;
|
|
145
|
-
font-size: 0.9em;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
code,
|
|
149
|
-
kbd,
|
|
150
|
-
samp {
|
|
151
|
-
font-size: 0.9em;
|
|
152
|
-
padding: 0 0.5em;
|
|
153
|
-
background-color: #4a4a4a;
|
|
154
|
-
white-space: pre-wrap;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
pre > code {
|
|
158
|
-
padding: 0;
|
|
159
|
-
background-color: transparent;
|
|
160
|
-
white-space: pre;
|
|
161
|
-
font-size: 1em;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/* Tables */
|
|
165
|
-
table {
|
|
166
|
-
text-align: justify;
|
|
167
|
-
width: 100%;
|
|
168
|
-
border-collapse: collapse;
|
|
169
|
-
margin-bottom: 2rem;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
td,
|
|
173
|
-
th {
|
|
174
|
-
padding: 0.5em;
|
|
175
|
-
border-bottom: 1px solid #4a4a4a;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/* Buttons, forms and input */
|
|
179
|
-
input,
|
|
180
|
-
textarea {
|
|
181
|
-
border: 1px solid #c9c9c9;
|
|
182
|
-
}
|
|
183
|
-
input:focus,
|
|
184
|
-
textarea:focus {
|
|
185
|
-
border: 1px solid #ffffff;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
textarea {
|
|
189
|
-
width: 100%;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.button,
|
|
193
|
-
button,
|
|
194
|
-
input[type='submit'],
|
|
195
|
-
input[type='reset'],
|
|
196
|
-
input[type='button'],
|
|
197
|
-
input[type='file']::file-selector-button {
|
|
198
|
-
display: inline-block;
|
|
199
|
-
padding: 5px 10px;
|
|
200
|
-
text-align: center;
|
|
201
|
-
text-decoration: none;
|
|
202
|
-
white-space: nowrap;
|
|
203
|
-
background-color: #ffffff;
|
|
204
|
-
color: #222222;
|
|
205
|
-
border-radius: 1px;
|
|
206
|
-
border: 1px solid #ffffff;
|
|
207
|
-
cursor: pointer;
|
|
208
|
-
box-sizing: border-box;
|
|
209
|
-
}
|
|
210
|
-
.button[disabled],
|
|
211
|
-
button[disabled],
|
|
212
|
-
input[type='submit'][disabled],
|
|
213
|
-
input[type='reset'][disabled],
|
|
214
|
-
input[type='button'][disabled],
|
|
215
|
-
input[type='file']::file-selector-button[disabled] {
|
|
216
|
-
cursor: default;
|
|
217
|
-
opacity: 0.5;
|
|
218
|
-
}
|
|
219
|
-
.button:hover,
|
|
220
|
-
button:hover,
|
|
221
|
-
input[type='submit']:hover,
|
|
222
|
-
input[type='reset']:hover,
|
|
223
|
-
input[type='button']:hover,
|
|
224
|
-
input[type='file']::file-selector-button:hover {
|
|
225
|
-
background-color: #c9c9c9;
|
|
226
|
-
color: #222222;
|
|
227
|
-
outline: 0;
|
|
228
|
-
}
|
|
229
|
-
.button:focus-visible,
|
|
230
|
-
button:focus-visible,
|
|
231
|
-
input[type='submit']:focus-visible,
|
|
232
|
-
input[type='reset']:focus-visible,
|
|
233
|
-
input[type='button']:focus-visible,
|
|
234
|
-
input[type='file']::file-selector-button:focus-visible {
|
|
235
|
-
outline-style: solid;
|
|
236
|
-
outline-width: 2px;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
textarea,
|
|
240
|
-
select,
|
|
241
|
-
input {
|
|
242
|
-
color: #c9c9c9;
|
|
243
|
-
padding: 6px 10px; /* The 6px vertically centers text on FF, ignored by Webkit */
|
|
244
|
-
margin-bottom: 10px;
|
|
245
|
-
background-color: #4a4a4a;
|
|
246
|
-
border: 1px solid #4a4a4a;
|
|
247
|
-
border-radius: 4px;
|
|
248
|
-
box-shadow: none;
|
|
249
|
-
box-sizing: border-box;
|
|
250
|
-
}
|
|
251
|
-
textarea:focus,
|
|
252
|
-
select:focus,
|
|
253
|
-
input:focus {
|
|
254
|
-
border: 1px solid #ffffff;
|
|
255
|
-
outline: 0;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
input[type='checkbox']:focus {
|
|
259
|
-
outline: 1px dotted #ffffff;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
label,
|
|
263
|
-
legend,
|
|
264
|
-
fieldset {
|
|
265
|
-
display: block;
|
|
266
|
-
margin-bottom: 0.5rem;
|
|
267
|
-
font-weight: 600;
|
|
268
|
-
}
|