Skip to content

Commit

Permalink
Merge branch 'feat/build'
Browse files Browse the repository at this point in the history
  • Loading branch information
hans000 committed Jan 14, 2024
2 parents 01663c7 + ef02c90 commit 691fd9d
Show file tree
Hide file tree
Showing 38 changed files with 2,817 additions and 1,819 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v1.16.0
- vite更新到5.0,antd更新到5.0
- 添加禁用类型,可设置禁用 xhr 或 fetch
- 添加插件拦截时机,可设置start end delay trigger override

## v1.15.0
- 添加run at功能

Expand Down
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
"build:local": "cross-env VITE_LOCAL=true node script.js && cross-env VITE_LOCAL=true npm run build:web && cross-env VITE_LOCAL=true npm run build:ts"
},
"dependencies": {
"@ant-design/icons": "^4.6.3",
"@ant-design/compatible": "^5.1.2",
"@ant-design/icons": "^5.2.6",
"@monaco-editor/react": "^4.4.6",
"antd": "^4.24.4",
"antd": "^5.12.1",
"json-schema": "^0.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand All @@ -27,19 +28,17 @@
"@types/node": "^18.14.6",
"@types/react": "^18.0.24",
"@types/react-dom": "^18.0.8",
"@vitejs/plugin-react": "^4.2.0",
"cross-env": "^7.0.3",
"less": "^4.1.1",
"less-loader": "^10.0.1",
"less": "^4.2.0",
"monaco-editor": "^0.33.0",
"rollup": "^2.75.6",
"rollup-plugin-external-globals": "^0.6.1",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.32.1",
"@vitejs/plugin-react": "^4.0.0-beta.0",
"typescript": "^5.0.2",
"vite": "^4.3.0",
"vite-plugin-cdn-import": "^0.3.5",
"vite-plugin-style-import": "^1.2.1"
"typescript": "^5.3.3",
"vite": "^5.0.0",
"vite-plugin-cdn-import": "^0.3.5"
},
"license": "GPL"
"license": "AGPL"
}
2,565 changes: 1,460 additions & 1,105 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions public/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
"action_refresh": {
"message": "Refresh Data"
},
"action_all_frames": {
"message": "All frames"
},
"action_theme": {
"message": "Switch Theme"
},
Expand Down Expand Up @@ -118,6 +121,24 @@
"run_at_trigger": {
"message": "trigger"
},
"run_at_override": {
"message": "override"
},
"ban_title": {
"message": "Ban Request Type"
},
"ban_xhr": {
"message": "xhr"
},
"ban_fetch": {
"message": "fetch"
},
"ban_none": {
"message": "none"
},
"ban_all": {
"message": "all"
},
"tip_send": {
"message": "Click to fetch request"
},
Expand All @@ -137,5 +158,8 @@
"content": "$1"
}
}
},
"quota_percent": {
"message": "Percent of quota"
}
}
26 changes: 25 additions & 1 deletion public/_locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
"action_refresh": {
"message": "刷新数据"
},
"action_all_frames": {
"message": "所有frame生效"
},
"action_theme": {
"message": "切换主题"
},
Expand Down Expand Up @@ -116,7 +119,25 @@
"message": "延时"
},
"run_at_trigger": {
"message": "拦截"
"message": "触发"
},
"run_at_override": {
"message": "重写"
},
"ban_title": {
"message": "设置禁用请求类型"
},
"ban_xhr": {
"message": "xhr"
},
"ban_fetch": {
"message": "fetch"
},
"ban_none": {
"message": ""
},
"ban_all": {
"message": "全部"
},
"tip_send": {
"message": "点击发送请求"
Expand All @@ -137,5 +158,8 @@
"content": "$1"
}
}
},
"quota_percent": {
"message": "存储占用率"
}
}
4 changes: 2 additions & 2 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Easy Interceptor",
"version": "1.15.1",
"version": "1.16.0",
"description": "__MSG_description__",
"permissions": [
"storage",
Expand All @@ -20,7 +20,7 @@
"default_locale": "zh_CN",
"content_security_policy" : "script-src 'self' 'unsafe-eval'; script-src-elem 'self' data: blob: https://unpkg.com; worker-src 'self' data: blob:; object-src 'self'",
"browser_action": {
"default_title": "Easy Interceptor by hans000",
"default_title": "Easy Interceptor by hans000 - v1.16.0",
"default_popup": "index.html",
"default_icon": "images/48-gray.png"
},
Expand Down
7 changes: 5 additions & 2 deletions readme-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
>
> 如果你是一个熟练度拉满,有着完善的代理环境大可不必使用,仅作为特定场合的补充
>
> 如果使用cdn版本,请保证能访问https://unpkg.com,首次加载会比较慢。或者直接使用local版本
> 如果使用cdn版本,请保证能访问https://unpkg.com,首次加载会比较慢。如果加载不出来也可直接使用local版本
## 🎉 特点

Expand Down Expand Up @@ -69,7 +69,9 @@
## 状态栏
- 【设置】:设置选项
- 【工作空间】:切换工作空间
- 【运行时机】:插件生效的时机,start-js注入即生效,end-DOMContentLoaded,delay-延时一定时间,trigger-当拦截到特定接口后触发
- 【运行时机】:插件生效的时机,start-js注入即生效,end-DOMContentLoaded,delay-延时一定时间,trigger-当拦截到特定接口后触发,override-当window上的xhr或者fetch被重写时
- 【禁用类型】:禁用请求类型:xhr 或者 fetch
- 【存储占用率】:展示数据占用率

### config面板

Expand All @@ -78,6 +80,7 @@
|url|string|请求地址|
|test|string|必选,匹配的请求地址,ant-path-matcher规则或字符串匹配,不允许写query参数|
|type|xhr\|fetch|请求类型|
|description|string|描述字段,做备注使用|
|response|object\|array\|null\boolean\|number|响应数据|
|responseText|string|响应数据|
|delay|number|延迟的毫秒数|
Expand Down
5 changes: 4 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ How to solve the above problems? If you can intercept and modify the data before
## Status Bar
- \[Setting\]: Setting
- [Work Space]: Switch work space
- [Run At]:four options can be choose. start (js injected will be work),end (DOMContentLoaded),delay (delay some times),trigger (match a url)
- [Run At]: four options can be choose. start (js injected will be work),end (DOMContentLoaded),delay (delay some times),trigger (match a url),override (window.XMLHttpRequest or window.fetch was override)
- \[Ban Type\]: Ban type, xhr or fetch
- \[Quota\]: Percent of quota


### Config Panel
Expand All @@ -82,6 +84,7 @@ How to solve the above problems? If you can intercept and modify the data before
|url|string|request url|
|test|string|required, match request url, ant-path-matcher rule or string match, cannot set query|
|type|xhr\|fetch|request type|
|description|string|note|
|response|object\|array\|null\boolean\|number||
|responseText|string||
|delay|number||
Expand Down
17 changes: 0 additions & 17 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,6 @@ if (! import.meta.env.DEV) {
loadLocalMocano()
}`,
},
{
filename: './src/App.tsx',
mark: 'injectDarkStyle',
code: `
const link = document.createElement('link')
link.setAttribute('dark', '')
link.href = 'https://unpkg.com/[email protected]/dist/antd.dark.css'
link.rel = 'stylesheet'
document.head.appendChild(link)`
},
{
filename: './src/dark.less',
mark: 'darkLess',
isLocal: true,
code: `
@import 'antd/dist/antd.dark.less';`
}
]

configList.forEach(config => {
Expand Down
17 changes: 12 additions & 5 deletions src/App.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}

@width: 300px;
@topHeight: 46px;
@topHeight: 40px;
@GWidth: 800px;
@GHeight: 600px;

Expand All @@ -31,11 +31,11 @@
transition: none;
}

&__quote {
&__quota {
position: absolute;
width: 100%;
z-index: 2;
top: 43px;
top: @topHeight - 2px;
line-height: 0;
}
&__editor {
Expand Down Expand Up @@ -75,7 +75,6 @@
display: flex;
justify-content: space-between;
align-items: center;
padding-left: 8px;
background-color: #eee;
box-shadow: #ccc 1px 1px 4px;
&.active {
Expand All @@ -99,14 +98,22 @@
padding: 0 4px;
background-color: #007acc;
color: white;
cursor: pointer;
&-item {
padding: 0 4px;
&:hover {
background-color: #1f89d1;
cursor: pointer;
}
}
}
&__upload button {
border-radius: 0;
}
}

.workspace .ant-select-selector {
padding-left: 4px!important;
padding-right: 0!important;
}

.nav__item {
Expand Down
Loading

0 comments on commit 691fd9d

Please sign in to comment.