Skip to content

Commit

Permalink
wip: mv3
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Jun 21, 2024
1 parent 389e6d2 commit 11c95f1
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 280 deletions.
1 change: 0 additions & 1 deletion docs/images/脚本猫通信架构.drawio

This file was deleted.

Binary file removed docs/images/脚本猫通信架构.drawio.png
Binary file not shown.
47 changes: 0 additions & 47 deletions docs/runtime.md

This file was deleted.

115 changes: 0 additions & 115 deletions docs/架构设计.md

This file was deleted.

88 changes: 0 additions & 88 deletions docs/通信机制.md

This file was deleted.

2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
"\\.[jt]s$": "babel-jest",
"\\.m[jt]s$": "babel-jest",
},
transformIgnorePatterns: ["node_modules/(?!(uuid|dexi|yaml))"],
transformIgnorePatterns: ["node_modules/(?!(uuid|dexie|yaml))"],
setupFiles: ["./pkg/chrome-extension-mock/index.ts"],
moduleDirectories: ["node_modules", "src"],
watch: false,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scriptcat",
"version": "0.16.3",
"version": "0.17.0-beta",
"description": "脚本猫,一个可以执行用户脚本的浏览器扩展,万物皆可脚本化,让你的浏览器可以做更多的事情!",
"author": "CodFrm",
"license": "GPLv3",
Expand Down
4 changes: 2 additions & 2 deletions pkg/chrome-extension-mock/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# mock一个chrome扩展环境
> 只针对自己的项目做了一些简单的封装,如果有需要可以自己修改
# mock 一个 chrome 扩展环境

> 只针对自己的项目做了一些简单的封装,如果有需要可以自己修改
2 changes: 2 additions & 0 deletions pkg/rpc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# RPC调用

33 changes: 21 additions & 12 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"manifest_version": 3,
"name": "__MSG_scriptcat__",
"version": "0.16.3",
"version": "0.17.0.1010",
"author": "CodFrm",
"description": "__MSG_scriptcat_description__",
"options_ui": {
Expand All @@ -12,16 +12,20 @@
"icons": {
"128": "assets/logo.png"
},
"browser_action": {
"action": {
"default_popup": "src/popup.html"
},
"background": {
"page": "src/background.html"
"service_worker": "src/service_worker.js"
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["src/content.js"],
"matches": [
"<all_urls>"
],
"js": [
"src/content.js"
],
"run_at": "document_start",
"all_frames": true
}
Expand All @@ -30,16 +34,21 @@
"tabs",
"cookies",
"storage",
"activeTab",
"scripting",
"offscreen",
"downloads",
"webRequest",
"background",
"<all_urls>",
"contextMenus",
"notifications",
"clipboardWrite",
"webRequestBlocking"
"declarativeNetRequest"
],
"host_permissions": [
"<all_urls>"
],
"sandbox": {
"pages": ["src/sandbox.html"]
"pages": [
"src/sandbox.html"
]
}
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/mocks/fileMock.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = 'test-file-stub';
module.exports = "test-file-stub";
13 changes: 1 addition & 12 deletions webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ const config: Configuration = {
entry: {
options: `${src}/pages/options/main.tsx`,
install: `${src}/pages/install/main.tsx`,
background: `${src}/background.ts`,
sandbox: `${src}/sandbox.ts`,
popup: `${src}/pages/popup/main.tsx`,
confirm: `${src}/pages/confirm/main.tsx`,
import: `${src}/pages/import/main.tsx`,
service_worker: `${src}/service_worker.ts`,
},
output: {
path: `${dist}/ext/src`,
Expand Down Expand Up @@ -73,17 +73,6 @@ const config: Configuration = {
},
chunks: ["popup"],
}),
new HtmlWebpackPlugin({
filename: `${dist}/ext/src/background.html`,
template: `${template}/background.html`,
inject: "head",
title: "ScriptCat",
minify: {
removeComments: true,
},
chunks: ["background"],
scriptLoading: "blocking",
}),
new HtmlWebpackPlugin({
filename: `${dist}/ext/src/confirm.html`,
template: `${template}/confirm.html`,
Expand Down

0 comments on commit 11c95f1

Please sign in to comment.