This commit is contained in:
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
由于这个变化,脚本猫的很多功能几乎全部需要重写,通信方面也要重新设计,一些功能也要重新考虑。虽然说都有替代方案,但还是有些烦躁。
|
由于这个变化,脚本猫的很多功能几乎全部需要重写,通信方面也要重新设计,一些功能也要重新考虑。虽然说都有替代方案,但还是有些烦躁。
|
||||||
|
|
||||||
|
另外我也还没有接触过 Service Worker,还需要学习一下,开发过程中可能还会遇到一些问题。
|
||||||
|
|
||||||
## DNR
|
## DNR
|
||||||
|
|
||||||
其次就是围绕着网络请求修改方面的,Manifest V2,可以使用[`webRequest API`](https://developer.chrome.com/docs/extensions/reference/api/webRequest?hl=zh-cn),可以非常自由的修改网络请求,然而 V3 版本这个 API 被移除了,取而代之的是 [`declarativeNetRequest API`](https://developer.chrome.com/docs/extensions/reference/api/declarativeNetRequest?hl=zh-cn),使用的是声明式的规则列表,甚至还有条数限制。这直接影响了 GM_xhr 的相关功能,例如:Forbidden header、匿名 cookie、set-cookie 等。
|
其次就是围绕着网络请求修改方面的,Manifest V2,可以使用[`webRequest API`](https://developer.chrome.com/docs/extensions/reference/api/webRequest?hl=zh-cn),可以非常自由的修改网络请求,然而 V3 版本这个 API 被移除了,取而代之的是 [`declarativeNetRequest API`](https://developer.chrome.com/docs/extensions/reference/api/declarativeNetRequest?hl=zh-cn),使用的是声明式的规则列表,甚至还有条数限制。这直接影响了 GM_xhr 的相关功能,例如:Forbidden header、匿名 cookie、set-cookie 等。
|
||||||
|
6
package-lock.json
generated
6
package-lock.json
generated
@ -16377,8 +16377,8 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@docusaurus/core": "^3.1.1",
|
"@docusaurus/core": "^3.4.0",
|
||||||
"@docusaurus/plugin-content-docs": "^3.1.1",
|
"@docusaurus/plugin-content-docs": "^3.4.0",
|
||||||
"dayjs": "^1.11.10",
|
"dayjs": "^1.11.10",
|
||||||
"reading-time": "^1.5.0",
|
"reading-time": "^1.5.0",
|
||||||
"simple-git": "^3.22.0"
|
"simple-git": "^3.22.0"
|
||||||
@ -16388,7 +16388,7 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@docusaurus/core": "^3.1.1",
|
"@docusaurus/core": "^3.4.0",
|
||||||
"dayjs": "^1.11.10",
|
"dayjs": "^1.11.10",
|
||||||
"reading-time": "^1.5.0"
|
"reading-time": "^1.5.0"
|
||||||
}
|
}
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@docusaurus/core": "^3.1.1",
|
"@docusaurus/core": "^3.4.0",
|
||||||
"@docusaurus/plugin-content-docs": "^3.1.1",
|
"@docusaurus/plugin-content-docs": "^3.4.0",
|
||||||
"dayjs": "^1.11.10",
|
"dayjs": "^1.11.10",
|
||||||
"reading-time": "^1.5.0",
|
"reading-time": "^1.5.0",
|
||||||
"simple-git": "^3.22.0"
|
"simple-git": "^3.22.0"
|
||||||
|
@ -98,16 +98,16 @@ export default async function pluginContentDocs(
|
|||||||
return ret;
|
return ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
const warpContentLoaded = ret.contentLoaded;
|
const warpAllContentLoaded = ret.allContentLoaded;
|
||||||
|
if (warpAllContentLoaded) {
|
||||||
ret.contentLoaded = async ({ content, actions, allContent }) => {
|
ret.allContentLoaded = async ({ actions, allContent }) => {
|
||||||
const ret = await warpContentLoaded({
|
const ret = await warpAllContentLoaded({
|
||||||
content,
|
actions,
|
||||||
actions,
|
allContent,
|
||||||
allContent,
|
});
|
||||||
});
|
return ret;
|
||||||
return ret;
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@docusaurus/core": "^3.1.1",
|
"@docusaurus/core": "^3.4.0",
|
||||||
"dayjs": "^1.11.10",
|
"dayjs": "^1.11.10",
|
||||||
"reading-time": "^1.5.0"
|
"reading-time": "^1.5.0"
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ export default function (context: LoadContext, options: any): Plugin {
|
|||||||
getThemePath() {
|
getThemePath() {
|
||||||
return themePath;
|
return themePath;
|
||||||
},
|
},
|
||||||
async contentLoaded({ content, actions, allContent }): Promise<void> {
|
async allContentLoaded({ actions, allContent }): Promise<void> {
|
||||||
const { addRoute, createData, setGlobalData } = actions;
|
const { addRoute, createData, setGlobalData } = actions;
|
||||||
|
|
||||||
const docsData = allContent["docusaurus-plugin-content-docs"] as {
|
const docsData = allContent["docusaurus-plugin-content-docs"] as {
|
||||||
|
Reference in New Issue
Block a user