Skip to content

Commit cdd8de2

Browse files
committed
docs: update docs
1 parent bd2ff2f commit cdd8de2

7 files changed

Lines changed: 61 additions & 34 deletions

File tree

docs/docs/guide/index.en-US.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Please choose a different installation method depending on your browser:
1515

1616
| Browser | Installation |
1717
| --- | --- |
18-
| ![Firefox Logo](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/73.0.0/firefox/firefox_16x16.png) Firefox | [Mozilla Add-on](https://addons.mozilla.org/en-US/firefox/addon/header-editor/) or our [self-distributed version](https://github.com/FirefoxBar/HeaderEditor/releases) |
19-
| ![Chrome Logo](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/73.0.0/chrome/chrome_16x16.png) Chrome | [Chrome Web Store](https://chrome.google.com/webstore/detail/header-editor/eningockdidmgiojffjmkdblpjocbhgh) |
20-
| ![Edge Logo](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/73.0.0/edge/edge_16x16.png) Edge(Chromium) | [Edge Addons](https://microsoftedge.microsoft.com/addons/detail/header-editor/afopnekiinpekooejpchnkgfffaeceko) |
18+
| ![Firefox Logo](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/75.0.1/firefox/firefox_16x16.png) Firefox | [Mozilla Add-on](https://addons.mozilla.org/en-US/firefox/addon/header-editor/) or our [self-distributed version](https://github.com/FirefoxBar/HeaderEditor/releases) |
19+
| ![Chrome Logo](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/75.0.1/chrome/chrome_16x16.png) Chrome | [Chrome Web Store](https://chrome.google.com/webstore/detail/header-editor/eningockdidmgiojffjmkdblpjocbhgh) |
20+
| ![Edge Logo](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/75.0.1/edge/edge_16x16.png) Edge(Chromium) | [Edge Addons](https://microsoftedge.microsoft.com/addons/detail/header-editor/afopnekiinpekooejpchnkgfffaeceko) |
2121

2222
## Features Comparison
2323

@@ -44,6 +44,7 @@ The features of the full version (Header Editor) and the lite version (Header Ed
4444
| Modify response body |||
4545

4646
Notes:
47+
* The Lite version has better performance. If there is no specific requirement, it is recommended to use the Lite version.
4748
* The "exclude" for Chrome/Edge browser will be supported in other ways in subsequent versions, but they not be completely consistent with the current support methods, and manual migration may be required.
4849
* If the corresponding feature is not supported, **the entire rule** will not take effect, but will still be retained. You can wait for subsequent versions to support it, or manually migrate to other browsers through the "Import and Export".
4950

docs/docs/guide/index.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ order: 1
1515

1616
| 浏览器 | 安装 |
1717
| --- | --- |
18-
| ![Firefox Logo](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/browser-logos/73.0.0/firefox/firefox_16x16.png) Firefox | [Mozilla Add-on](https://addons.mozilla.org/en-US/firefox/addon/header-editor/) 或 我们的[自分发版本](https://github.com/FirefoxBar/HeaderEditor/releases) |
19-
| ![Chrome Logo](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/73.0.0/chrome/chrome_16x16.png) Chrome | [Chrome Web Store](https://chrome.google.com/webstore/detail/header-editor/eningockdidmgiojffjmkdblpjocbhgh) |
20-
| ![Edge Logo](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/73.0.0/edge/edge_16x16.png) Edge(Chromium) | [Edge Addons](https://microsoftedge.microsoft.com/addons/detail/header-editor/afopnekiinpekooejpchnkgfffaeceko) |
18+
| ![Firefox Logo](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/75.0.1/firefox/firefox_16x16.png) Firefox | [Mozilla Add-on](https://addons.mozilla.org/en-US/firefox/addon/header-editor/) 或 我们的[自分发版本](https://github.com/FirefoxBar/HeaderEditor/releases) |
19+
| ![Chrome Logo](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/75.0.1/chrome/chrome_16x16.png) Chrome | [Chrome Web Store](https://chrome.google.com/webstore/detail/header-editor/eningockdidmgiojffjmkdblpjocbhgh) |
20+
| ![Edge Logo](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/75.0.1edge/edge_16x16.png) Edge(Chromium) | [Edge Addons](https://microsoftedge.microsoft.com/addons/detail/header-editor/afopnekiinpekooejpchnkgfffaeceko) |
2121

2222
## 功能比较
2323

@@ -44,6 +44,7 @@ order: 1
4444
| 修改响应体 |||
4545

4646
备注:
47+
* Lite 版本性能更好,如无特定需求,建议使用 Lite 版本。
4748
* Chrome/Edge 浏览器的排除规则将在后续版本中以其他方式支持,但无法与当前支持方式完全一致,可能需要手动迁移。
4849
* 若不支持对应功能,**整个规则**不会生效,但仍然会被保留,您可以等待后续版本支持,或通过“导入和导出”功能,手动迁移到其他浏览器。
4950

docs/docs/guide/index.zh-TW.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ order: 1
1515

1616
| 浏览器 | 安装 |
1717
| --- | --- |
18-
| ![Firefox Logo](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/73.0.0/firefox/firefox_16x16.png) Firefox | [Mozilla Add-on](https://addons.mozilla.org/en-US/firefox/addon/header-editor/) 或 我们的[自分发版本](https://github.com/FirefoxBar/HeaderEditor/releases) |
19-
| ![Chrome Logo](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/73.0.0/chrome/chrome_16x16.png) Chrome | [Chrome Web Store](https://chrome.google.com/webstore/detail/header-editor/eningockdidmgiojffjmkdblpjocbhgh) |
20-
| ![Edge Logo](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/73.0.0/edge/edge_16x16.png) Edge(Chromium) | [Edge Addons](https://microsoftedge.microsoft.com/addons/detail/header-editor/afopnekiinpekooejpchnkgfffaeceko) |
18+
| ![Firefox Logo](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/75.0.1/firefox/firefox_16x16.png) Firefox | [Mozilla Add-on](https://addons.mozilla.org/en-US/firefox/addon/header-editor/) 或 我们的[自分发版本](https://github.com/FirefoxBar/HeaderEditor/releases) |
19+
| ![Chrome Logo](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/75.0.1/chrome/chrome_16x16.png) Chrome | [Chrome Web Store](https://chrome.google.com/webstore/detail/header-editor/eningockdidmgiojffjmkdblpjocbhgh) |
20+
| ![Edge Logo](https://cdnjs.cloudflare.com/ajax/libs/browser-logos/75.0.1/edge/edge_16x16.png) Edge(Chromium) | [Edge Addons](https://microsoftedge.microsoft.com/addons/detail/header-editor/afopnekiinpekooejpchnkgfffaeceko) |
2121

2222
## 功能比較
2323

@@ -44,6 +44,7 @@ order: 1
4444
| 修改回應主體 |||
4545

4646
筆記:
47+
* Lite 版本效能較佳,如無特殊需求,建議使用 Lite 版本。
4748
* Chrome/Edge 瀏覽器的「排除」功能將在後續版本中以其他方式支持,但與目前的支援方式不完全一致,可能需要手動遷移。
4849
* 如果不支援相應的功能,**整個規則**將不會生效,但仍會保留。您可以等待後續版本支持,或透過「匯入匯出」手動遷移到其他瀏覽器。
4950

docs/docs/guide/rule.en-US.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ order: 1
1010

1111
### Match type
1212

13-
Rules will apply to the URL that meets the matching criteria
13+
Rules will apply to the URL that meets the matching criteria. If multiple conditions are checked, all conditions must be met at the same time for this rule to be applied.
1414

1515
* All: Correspond to all urls, including the Header Editor itself
1616
* Regular expression
@@ -20,24 +20,31 @@ Rules will apply to the URL that meets the matching criteria
2020
* URL prefix: Including `http://` URL prefix
2121
* Domain name: The full domain name that contains the subdomain
2222
* URL: Including "?" And the full address of all subsequent content
23+
* Method: GET/POST and other request methods.
24+
* Resource type: web page, image, CSS style, etc.
25+
26+
Note:
27+
* The method and resource type can only be configured in either match or exclude.
2328

2429
### Exclude
2530

26-
The rule will not take effect on the URL which is match the "exclude".
31+
Regardless of whether the matching rules are met, as long as any exclusion condition is met, this item will not take effect on the current URL.
32+
* The Lite version does not support configuring regular expressions in exclusion.
2733

2834
### Custom function
2935

3036
Through a custom function to realize a more flexible function, the specific use please see [here](./custom-function.md)
37+
* This feature is not supported in the Lite version.
3138

3239
## Other special features
3340

3441
* When using "Modify request header" or "Modify response header", set the header content to `_header_editor_remove_` will remove this header (valid since 3.0.5)
35-
3642
* When using "Redirect request" with custom function, return `_header_editor_cancel_` will cancel this request (valid since 4.0.3)
3743

3844
## Other considerations
3945

4046
* If you want to set a header content to empty, different browsers have different behaviors. Chrome will keep this header but its content will be empty. Firefox will remove this header
47+
* Browsers restrict modification of specific URLs. For example, in Chrome and similar browsers (such as 360 Browser), extensions do not have permission to modify any request starting with `chrome.google.com/webstore`.
4148

4249
## A common feature example
4350

docs/docs/guide/rule.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,41 @@ HE本身并不具备任何功能,它只是提供了管理和编写规则的能
1515

1616
规则会应用到满足相应匹配条件的URL上。若勾选了多个条件,则需同时满足所有条件,才能应用此规则。
1717

18-
* 全部:对应所有URL,包括Header Editor自身
18+
* 全部:对应所有URL。
1919
* 正则表达式:
2020
* 支持标准的JS正则表达式。例如你输入的正则表达式是`str`,那么,实际上,程序内部就会使用`new RegExp(str)`初始化正则表达式。
21-
* 如果匹配规则是正则表达式,则修改结果(目前包括重定向至)支持使用形似`$1`的占位符
22-
* 在[Mozilla Developer Network](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/RegExp)上了解更多关于正则表达式的内容
23-
* 网址前缀:包括`http://`在内的网址前缀
24-
* 域名:包含子域名在内的完整的域名
25-
* 网址:包括“?”及之后的所有内容的完整地址
21+
* 如果匹配规则是正则表达式,则修改结果(目前包括重定向至)支持使用形似`$1`的占位符。
22+
* 在[Mozilla Developer Network](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/RegExp)上了解更多关于正则表达式的内容。
23+
* 网址前缀:包括`https://`在内的网址前缀。
24+
* 域名:包含子域名在内的完整的域名。
25+
* 网址:包括“?”及之后的所有内容的完整地址。
26+
* 请求方法:GET/POST等请求方法。
27+
* 资源类型:网页、图片、CSS样式等。
28+
29+
注意:
30+
* 请求方法、资源类型只能在请求或排除中二选一配置。
2631

2732
### 排除规则
2833

29-
不论是否满足匹配规则,只要满足了排除规则,那么此条均不会对当前URL生效
34+
不论是否满足匹配规则,只要满足了任一排除条件,那么此条均不会对当前URL生效。
35+
36+
* Lite 版本不支持在排除中配置正则表达式。
3037

3138
### 自定义函数
3239

3340
通过自定义函数实现更灵活的功能,具体使用请参见[此处](./custom-function.md)
3441

42+
* Lite 版本不支持该功能。
43+
3544
## 其他特殊功能
3645

3746
* 使用功能“修改请求头”或“修改响应头”时,将头内容设置为`_header_editor_remove_`将会移除此头(自3.0.5起有效)
38-
3947
* 使用功能“重定向请求”且使用自定义函数时,返回`_header_editor_cancel_`将阻止此请求(自4.0.3开始有效)
4048

4149
## 其他注意事项
4250

43-
* 将头内容设置为空,不同浏览器对此处理方式不同。Chrome将会保留此头信息,但其内容为空。Firefox则会移除此头信息
51+
* 将头内容设置为空,不同浏览器对此处理方式不同。Chrome将会保留此头信息,但其内容为空。Firefox则会移除此头信息。
52+
* 浏览器会限制对特定 URL 的修改,例如在 Chrome 及类似浏览器(如360浏览器)中,扩展无权修改以`chrome.google.com/webstore`开头的任何请求。
4453

4554
## 常见功能示例
4655

@@ -70,4 +79,4 @@ HE本身并不具备任何功能,它只是提供了管理和编写规则的能
7079

7180
#### 伪装UA
7281

73-
修改请求头的User-Agent即可,但功能只能影响服务器判断UA的能力,对于在本地通过JS判断的,无法伪装
82+
修改请求头的`User-Agent`即可,但功能只能影响服务器判断UA的能力,对于在本地通过JS判断的,无法伪装

docs/docs/guide/rule.zh-TW.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ HE本身并不具备任何功能,它只是提供了管理和编写规则的能
1212

1313
### 匹配类型
1414

15-
规则会应用到满足相应匹配条件的URL上。
15+
规则会应用到满足相应匹配条件的URL上。如果檢查多個條件,則必須同時滿足所有條件才能套用此規則。
1616

1717
* 全部:对应所有URL,包括Header Editor自身。
1818
* 正規表示式:
@@ -22,10 +22,16 @@ HE本身并不具备任何功能,它只是提供了管理和编写规则的能
2222
* 網址首碼:包括`http://`在內的網址首碼。
2323
* 域名:包含子域名在內的完整的域名。
2424
* 網址:包括“?”及之後的所有內容的完整位址。
25+
* 方法:GET/POST 等請求方法。
26+
* 資源類型:網頁、圖片、CSS 樣式等。
2527

26-
### 排除规则
28+
注意:
29+
* 方法和資源類型只能在匹配类型或排除中配置一個。
2730

28-
不论是否满足匹配规则,只要满足了排除规则,那么此条均不会对当前URL生效
31+
### 排除
32+
33+
無論符合規則是否滿足,只要滿足任一排除條件,此項都不會對目前 URL 生效。
34+
* 精簡版不支援在排除中配置正規表示式。
2935

3036
### 自定义函数
3137

@@ -34,12 +40,12 @@ HE本身并不具备任何功能,它只是提供了管理和编写规则的能
3440
## 其他特殊功能
3541

3642
* 使用功能“修改请求头”或“修改响应头”时,将头内容设置为`_header_editor_remove_`将会移除此头(自3.0.5起有效)
37-
3843
* 使用功能“重定向请求”且使用自定义函数时,返回`_header_editor_cancel_`将阻止此请求(自4.0.3开始有效)
3944

4045
## 其他注意事项
4146

42-
* 将头内容设置为空,不同浏览器对此处理方式不同。Chrome将会保留此头信息,但其内容为空。Firefox则会移除此头信息
47+
* 将头内容设置为空,不同浏览器对此处理方式不同。Chrome将会保留此头信息,但其内容为空。Firefox则会移除此头信息。
48+
* 瀏覽器限制修改特定的 URL。例如,在 Chrome 和類似瀏覽器(如 360 瀏覽器)中,擴充功能無權修改任何以`chrome.google.com/webstore`開頭的請求。
4349

4450
## 常见功能示例
4551

scripts/browser-config/get-manifest.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ function getManifest(browser, options) {
5151
}
5252

5353
if (config.ENABLE_EVAL) {
54-
manifest.content_security_policy = "script-src 'self' 'unsafe-eval'; object-src 'self';";
54+
manifest.content_security_policy =
55+
"script-src 'self' 'unsafe-eval'; object-src 'self';";
5556
}
5657

5758
if (config.ENABLE_WEB_REQUEST) {
@@ -79,27 +80,27 @@ function getManifest(browser, options) {
7980
}
8081

8182
if (options && options.dev && browser.startsWith('chrome')) {
82-
const ext = extensionConfig.crx.find((x) => x.browser === browser);
83+
const ext = extensionConfig.crx.find(x => x.browser === browser);
8384
if (ext && ext.public_key) {
8485
manifest.key = ext.public_key;
8586
}
8687
}
8788

8889
if (browser.startsWith('firefox')) {
8990
if (options && options.amo) {
90-
const id = extensionConfig.amo.find((x) => x.browser === browser).id;
91+
const id = extensionConfig.amo.find(x => x.browser === browser).id;
9192
manifest.browser_specific_settings = {
9293
gecko: {
9394
id,
94-
strict_min_version: '77.0',
95+
strict_min_version: '113.0',
9596
},
9697
};
9798
} else {
98-
const id = extensionConfig.xpi.find((x) => x.browser === browser).id;
99+
const id = extensionConfig.xpi.find(x => x.browser === browser).id;
99100
manifest.browser_specific_settings = {
100101
gecko: {
101102
id,
102-
strict_min_version: '77.0',
103+
strict_min_version: '113.0',
103104
update_url:
104105
config.MANIFEST_VER === 'v2'
105106
? 'https://ext.firefoxcn.net/header-editor/install/update.json'
@@ -109,7 +110,8 @@ function getManifest(browser, options) {
109110
}
110111
} else {
111112
if (config.MANIFEST_VER === 'v2') {
112-
manifest.update_url = 'https://ext.firefoxcn.net/header-editor/install/update.xml';
113+
manifest.update_url =
114+
'https://ext.firefoxcn.net/header-editor/install/update.xml';
113115
}
114116
}
115117

0 commit comments

Comments
 (0)