We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
类似插件https://he.firefoxcn.net/guide/custom-function#%E5%A6%82%E4%BD%95%E8%B0%83%E8%AF%95%E8%87%AA%E5%AE%9A%E4%B9%89%E5%87%BD%E6%95%B0的功能,但是可自定义更强
请求头/响应头
Referer
User-Agent
interface CAT_headerEditor_Rule { /** * 匹配规则 */ pattern: string | RegExp; /** * 排除规则 */ exclude: string | RegExp; } interface CAT_headerEditor_HeaderRule { /** * 传入Header,修改header * @param headers * @example * (headers)=>{ * headers.set("Referer","xxxxxx"); * headers.delete("Referer"); * headers.set("User-Agent": "xxxx"); * return headers; * } */ callback: (headers: Headers) => Headers; } /** * 阻止请求 */ interface CAT_headerEditor_blockRequest extends CAT_headerEditor_Rule { ruleType: "blockRequest"; } /** * 重定向请求 */ interface CAT_headerEditor_redirectRequest extends CAT_headerEditor_Rule { ruleType: "redirectRequest"; /** * 传入完整的url * @param url * @returns * + null|undefined: 跳过 * + string: 重定向URL * + "_header_editor_cancel_": 取消请求 */ callback: ( url: string ) => string | null | undefined | "_header_editor_cancel_"; } /** * 修改请求头 */ interface CAT_headerEditor_modifyRequestHeader extends CAT_headerEditor_Rule, CAT_headerEditor_HeaderRule { ruleType: "modifyRequestHeader"; } /** * 修改响应头 */ interface CAT_headerEditor_modifyResponseHeader extends CAT_headerEditor_Rule, CAT_headerEditor_HeaderRule { ruleType: "modifyResponseHeader"; } /** * 修改响应体 * @only firefox */ interface CAT_headerEditor_modifyResponseBody extends CAT_headerEditor_Rule { ruleType: "modifyResponseBody"; } /** * 所有的规则类型 */ type CAT_headerEditor_OptionRuleType = | CAT_headerEditor_blockRequest["ruleType"] | CAT_headerEditor_redirectRequest["ruleType"] | CAT_headerEditor_modifyRequestHeader["ruleType"] | CAT_headerEditor_modifyResponseHeader["ruleType"] | CAT_headerEditor_modifyResponseBody["ruleType"]; /** * 配置 */ interface CAT_headerEditor_Option { ruleType: CAT_headerEditor_OptionRuleType; } export const CAT_headerEditor = function (option: CAT_headerEditor_Option) { // 具体实现 };
The text was updated successfully, but these errors were encountered:
感觉不错,具体的等mv3重构完成再看看如何设计
Sorry, something went wrong.
v3 响应结果好像改不了
响应结果mv2、mv3都改不了的
No branches or pull requests
类似插件https://he.firefoxcn.net/guide/custom-function#%E5%A6%82%E4%BD%95%E8%B0%83%E8%AF%95%E8%87%AA%E5%AE%9A%E4%B9%89%E5%87%BD%E6%95%B0的功能,但是可自定义更强
请求头/响应头
,如Referer
、User-Agent
The text was updated successfully, but these errors were encountered: