upgrade docusaurus
Some checks failed
Release / deploy (push) Failing after 10s

This commit is contained in:
王一之 2024-06-04 10:31:37 +08:00
parent ccd91b7af4
commit ff6d07d414
7 changed files with 19 additions and 17 deletions

View File

@ -16,6 +16,8 @@
由于这个变化,脚本猫的很多功能几乎全部需要重写,通信方面也要重新设计,一些功能也要重新考虑。虽然说都有替代方案,但还是有些烦躁。
另外我也还没有接触过 Service Worker还需要学习一下开发过程中可能还会遇到一些问题。
## 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 等。

6
package-lock.json generated
View File

@ -16377,8 +16377,8 @@
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"@docusaurus/core": "^3.1.1",
"@docusaurus/plugin-content-docs": "^3.1.1",
"@docusaurus/core": "^3.4.0",
"@docusaurus/plugin-content-docs": "^3.4.0",
"dayjs": "^1.11.10",
"reading-time": "^1.5.0",
"simple-git": "^3.22.0"
@ -16388,7 +16388,7 @@
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"@docusaurus/core": "^3.1.1",
"@docusaurus/core": "^3.4.0",
"dayjs": "^1.11.10",
"reading-time": "^1.5.0"
}

View File

@ -9,8 +9,8 @@
"author": "",
"license": "ISC",
"dependencies": {
"@docusaurus/core": "^3.1.1",
"@docusaurus/plugin-content-docs": "^3.1.1",
"@docusaurus/core": "^3.4.0",
"@docusaurus/plugin-content-docs": "^3.4.0",
"dayjs": "^1.11.10",
"reading-time": "^1.5.0",
"simple-git": "^3.22.0"

View File

@ -98,16 +98,16 @@ export default async function pluginContentDocs(
return ret;
};
const warpContentLoaded = ret.contentLoaded;
ret.contentLoaded = async ({ content, actions, allContent }) => {
const ret = await warpContentLoaded({
content,
actions,
allContent,
});
return ret;
};
const warpAllContentLoaded = ret.allContentLoaded;
if (warpAllContentLoaded) {
ret.allContentLoaded = async ({ actions, allContent }) => {
const ret = await warpAllContentLoaded({
actions,
allContent,
});
return ret;
};
}
return ret;
}

View File

@ -9,7 +9,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@docusaurus/core": "^3.1.1",
"@docusaurus/core": "^3.4.0",
"dayjs": "^1.11.10",
"reading-time": "^1.5.0"
}

View File

@ -51,7 +51,7 @@ export default function (context: LoadContext, options: any): Plugin {
getThemePath() {
return themePath;
},
async contentLoaded({ content, actions, allContent }): Promise<void> {
async allContentLoaded({ actions, allContent }): Promise<void> {
const { addRoute, createData, setGlobalData } = actions;
const docsData = allContent["docusaurus-plugin-content-docs"] as {