docs(pages): 恢复 Chrome 对 Manifest V2 的支持

1. docs(pages): 恢复 Chrome 对 Manifest V2 的支持
2. style(pages): 文本美化
3. feat(config):  target="_blank" 插件:rehype-external-links
4. style(music): 增加一个音乐:准备出发
This commit is contained in:
Ad-closeNN
2025-08-14 11:49:26 +08:00
parent 6f2cf9433c
commit 26ccc0fb60
13 changed files with 124 additions and 12 deletions
+7
View File
@@ -23,6 +23,7 @@ import { parseDirectiveNode } from "./src/plugins/remark-directive-rehype.js";
import { remarkExcerpt } from "./src/plugins/remark-excerpt.js"; import { remarkExcerpt } from "./src/plugins/remark-excerpt.js";
import { remarkReadingTime } from "./src/plugins/remark-reading-time.mjs"; import { remarkReadingTime } from "./src/plugins/remark-reading-time.mjs";
import { pluginCustomCopyButton } from "./src/plugins/expressive-code/custom-copy-button.js"; import { pluginCustomCopyButton } from "./src/plugins/expressive-code/custom-copy-button.js";
import rehypeExternalLinks from 'rehype-external-links';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
@@ -128,6 +129,12 @@ export default defineConfig({
}, },
}, },
], ],
[
rehypeExternalLinks,
{
target: '_blank',
},
],
[ [
rehypeAutolinkHeadings, rehypeAutolinkHeadings,
{ {
+1
View File
@@ -48,6 +48,7 @@
"reading-time": "^1.5.0", "reading-time": "^1.5.0",
"rehype-autolink-headings": "^7.1.0", "rehype-autolink-headings": "^7.1.0",
"rehype-components": "^0.3.0", "rehype-components": "^0.3.0",
"rehype-external-links": "^3.0.0",
"rehype-katex": "^7.0.1", "rehype-katex": "^7.0.1",
"rehype-slug": "^6.0.0", "rehype-slug": "^6.0.0",
"remark-directive": "^3.0.1", "remark-directive": "^3.0.1",
+21
View File
@@ -104,6 +104,9 @@ importers:
rehype-components: rehype-components:
specifier: ^0.3.0 specifier: ^0.3.0
version: 0.3.0 version: 0.3.0
rehype-external-links:
specifier: ^3.0.0
version: 3.0.0
rehype-katex: rehype-katex:
specifier: ^7.0.1 specifier: ^7.0.1
version: 7.0.1 version: 7.0.1
@@ -3018,6 +3021,10 @@ packages:
iron-webcrypto@1.2.1: iron-webcrypto@1.2.1:
resolution: {integrity: sha512-feOM6FaSr6rEABp/eDfVseKyTMDt+KGpeB35SkVn9Tyn0CqvVsY3EwI0v5i8nMHyJnzCIQf7nsy3p41TPkJZhg==} resolution: {integrity: sha512-feOM6FaSr6rEABp/eDfVseKyTMDt+KGpeB35SkVn9Tyn0CqvVsY3EwI0v5i8nMHyJnzCIQf7nsy3p41TPkJZhg==}
is-absolute-url@4.0.1:
resolution: {integrity: sha512-/51/TKE88Lmm7Gc4/8btclNXWS+g50wXhYJq8HWIBAGUBnoAdRu1aXeh364t/O7wXDAcTJDP8PNuNKWUDWie+A==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
is-alphabetical@2.0.1: is-alphabetical@2.0.1:
resolution: {integrity: sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==} resolution: {integrity: sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==}
@@ -4312,6 +4319,9 @@ packages:
rehype-expressive-code@0.41.3: rehype-expressive-code@0.41.3:
resolution: {integrity: sha512-8d9Py4c/V6I/Od2VIXFAdpiO2kc0SV2qTJsRAaqSIcM9aruW4ASLNe2kOEo1inXAAkIhpFzAHTc358HKbvpNUg==} resolution: {integrity: sha512-8d9Py4c/V6I/Od2VIXFAdpiO2kc0SV2qTJsRAaqSIcM9aruW4ASLNe2kOEo1inXAAkIhpFzAHTc358HKbvpNUg==}
rehype-external-links@3.0.0:
resolution: {integrity: sha512-yp+e5N9V3C6bwBeAC4n796kc86M4gJCdlVhiMTxIrJG5UHDMh+PJANf9heqORJbt1nrCbDwIlAZKjANIaVBbvw==}
rehype-katex@7.0.1: rehype-katex@7.0.1:
resolution: {integrity: sha512-OiM2wrZ/wuhKkigASodFoo8wimG3H12LWQaH8qSPVJn9apWKFSH3YOCtbKpBorTVw/eI7cuT21XBbvwEswbIOA==} resolution: {integrity: sha512-OiM2wrZ/wuhKkigASodFoo8wimG3H12LWQaH8qSPVJn9apWKFSH3YOCtbKpBorTVw/eI7cuT21XBbvwEswbIOA==}
@@ -8653,6 +8663,8 @@ snapshots:
iron-webcrypto@1.2.1: {} iron-webcrypto@1.2.1: {}
is-absolute-url@4.0.1: {}
is-alphabetical@2.0.1: {} is-alphabetical@2.0.1: {}
is-alphanumerical@2.0.1: is-alphanumerical@2.0.1:
@@ -10144,6 +10156,15 @@ snapshots:
dependencies: dependencies:
expressive-code: 0.41.3 expressive-code: 0.41.3
rehype-external-links@3.0.0:
dependencies:
'@types/hast': 3.0.4
'@ungap/structured-clone': 1.3.0
hast-util-is-element: 3.0.0
is-absolute-url: 4.0.1
space-separated-tokens: 2.0.2
unist-util-visit: 5.0.0
rehype-katex@7.0.1: rehype-katex@7.0.1:
dependencies: dependencies:
'@types/hast': 3.0.4 '@types/hast': 3.0.4
+5
View File
@@ -55,6 +55,11 @@ const isSunday = new Date().getDay() === 0;
{isSunday && {isSunday &&
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=250 height=86 src="//music.163.com/outchain/player?type=2&id=2155423467&auto=0&height=66"></iframe> <iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=250 height=86 src="//music.163.com/outchain/player?type=2&id=2155423467&auto=0&height=66"></iframe>
} }
<!-- 其他日 -->
{!isSunday &&
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=250 height=86 src="//music.163.com/outchain/player?type=2&id=2608813264&auto=0&height=66"></iframe>
}
</div> </div>
</div> </div>
Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

-4
View File
@@ -23,10 +23,6 @@ customcover: ../assets/images/cloudflare-turnstile-verify-error.png
你好~ 你好~
我的 Captcha 还蛮多的,欢迎你们来这里玩,玩累了就直接刷新,没问题的~ 我的 Captcha 还蛮多的,欢迎你们来这里玩,玩累了就直接刷新,没问题的~
:::NOTE[抱歉]
现在只有两家 Captcha,后续会慢慢补上其他 Captcha 的!
:::
# Google reCaptcha V2 # Google reCaptcha V2
## 休闲版(不保证) ## 休闲版(不保证)
<div class="g-recaptcha" data-sitekey="6LerBqQrAAAAAJm_8-H-wq25iSKxprYEW8G_XYhi"></div> <div class="g-recaptcha" data-sitekey="6LerBqQrAAAAAJm_8-H-wq25iSKxprYEW8G_XYhi"></div>
@@ -0,0 +1,64 @@
---
title: 恢复 Chrome 对 Manifest V2 的支持
published: 2025-08-14
tags: ["bypass"]
description: 2025 年 7 月 24 日:Chrome 会在所有位置停用 Manifest V2 扩展,所以某些扩展要怎么恢复?
image: ../assets/images/chrome-ext-block.png
showcover: false
customcover: ../assets/images/chrome-ext-force-custom-font.png
category: 教程
draft: false
---
# 前言
:::tip[提示]
本文「扩展」=「扩展程序」= 「插件」。
参考:https://blog.hentioe.dev/posts/continue-using-chrome-manifest-v2.html
:::
今天打开电脑,发现 Chrome 它阻止了一个扩展(如上图)。
查了一下,发现是 Google Chrome 已经永久停止了对 Manifest V2 扩展的支持,而且是已经计划了近4年的项目。在 2025年7月终于要落下帷幕**了**:
- [2022 年 1 月:Chrome 应用商店停止接受新的 Manifest V2 扩展程序](https://developer.chrome.com/docs/extensions/develop/migrate/mv2-deprecation-timeline?hl=zh-cn#january_2022_chrome_web_store_-_no_new_public_unlisted_extensions)
- [2022 年 6 月:Chrome 应用商店已停止接受将公开范围设置为“专用”的新 Manifest V2 扩展程序](https://developer.chrome.com/docs/extensions/develop/migrate/mv2-deprecation-timeline?hl=zh-cn#june_2022_chrome_web_store_-_no_new_private_extensions)
- [2024 年 6 月 3 日:Chrome 开始逐步淘汰 Manifest V2](https://developer.chrome.com/docs/extensions/develop/migrate/mv2-deprecation-timeline?hl=zh-cn#june_3rd_2024_the_manifest_v2_phase-out_begins)
- [2024 年 10 月 9 日:Chrome 扩展页面会向使用 Manifest V2 扩展程序的所有用户显示警告横幅](https://developer.chrome.com/docs/extensions/develop/migrate/mv2-deprecation-timeline?hl=zh-cn#october_9th_2024_an_update_on_manifest_v2_phase-out)
- [2025 年 3 月 31 日:停用 Manifest V2,但仍可以选择重新启用扩展程序](https://developer.chrome.com/docs/extensions/develop/migrate/mv2-deprecation-timeline?hl=zh-cn#march_31st_2025_manifest_v2_is_disabled_with_the_option_to_re-enable_extensions)
- [2025 年 7 月 24 日:在所有位置停用 Manifest V2](https://developer.chrome.com/docs/extensions/develop/migrate/mv2-deprecation-timeline?hl=zh-cn#jul_24th_2025_manifest_v2_is_disabled_everywhere)
**吗?**
# 解决方案
## 通过 chrome://flags 关闭
:::warning[注意]
目前并不能确认 Chrome 139.0.7258.128 之后的版本是否能继续使用此方法。但可以确定的是,稳定版 139.0.7258.128 能继续使用 Flags 控制开关。
![chrome-139.0.7258.128-about](../assets/images/chrome-139.0.7258.128-about.png)
:::
1. 地址栏输入 `chrome://flags/`
2. 搜索 `temporary-unexpire-flags-m137`
3. 将这个条目设置为 `Enabled`
4. 重启浏览器。
5. 搜索 `extension-manifest-v2-deprecation-disabled`,将其设置为 `Disabled`
6. 搜索 `extension-manifest-v2-deprecation-unsupported`,将其设置为 `Disabled`
7. 重启浏览器,即可启用旧版扩展。
## 添加启动参数
![windows-chrome-lnk-panel](../assets/images/windows-chrome-lnk-panel.png)
1. 关闭 Chrome。
2. 打开 Chrome 的快捷方式属性。
3.**目标** 后加上一个**空格**和 `--disable-features=ExtensionManifestV2Unsupported,ExtensionManifestV2Disabled`
4. 点击 **确定**
5. 再次双击 Chrome 快捷方式,打开 Chrome,即可启用旧版扩展(**暂时保留** 按钮将会出现)。 ![chrome-ext-force-custom-font-2](../assets/images/chrome-ext-force-custom-font-2.png)
## 换浏览器
### FireFox
[FireFox - 火狐](https://www.firefox.com/zh-CN/) 。它并**不**基于 Chromium [FireFox 常见问题](https://www.firefox.com/zh-CN/more/faq/) 。并且它将会 [继续支持 Manifest V2 扩展](https://blog.mozilla.org/addons/2024/03/13/manifest-v3-manifest-v2-march-2024-update/) 。~FireFox 这招太狠了~
---
# 其他
## Microsoft Edge
好吧,微软也放弃了其新 Edge 对 Manifest V2 的支持,强制关闭时间**待定**:[迁移到清单 V3 的概述和时间线 - Microsoft Edge Developer documentation | Microsoft Learn](https://learn.microsoft.com/zh-cn/microsoft-edge/extensions/developer-guide/manifest-v3) 。
+12 -1
View File
@@ -14,6 +14,17 @@ customcover: ../assets/images/custom-frontmatter-customcover.svg
这篇文章的目的是 **在 Markdown 文件的顶端加入一个自定义的类似 `draft: true` 这类变量控制器**,可以运用它对某些组件进行更改,包括关闭、更改。例如,当你在 fuwari 中的 Markdown 顶端定义一个内置参数 `image`,你可以通过写 `image: "../assets/images/custom-frontmatter-cover.svg"` 来让这篇文章在**博客主页**获得一个图片(而不定义就只有一个 `>` 的按钮): ![frontmatter-image-example](../assets/images/frontmatter-image-example.png) 这篇文章的目的是 **在 Markdown 文件的顶端加入一个自定义的类似 `draft: true` 这类变量控制器**,可以运用它对某些组件进行更改,包括关闭、更改。例如,当你在 fuwari 中的 Markdown 顶端定义一个内置参数 `image`,你可以通过写 `image: "../assets/images/custom-frontmatter-cover.svg"` 来让这篇文章在**博客主页**获得一个图片(而不定义就只有一个 `>` 的按钮): ![frontmatter-image-example](../assets/images/frontmatter-image-example.png)
就是说:
```md title="src/content/posts/custom-frontmatter.md" {3,4}
--- # 这里是 Frontmatter 的开头
image: /a/example.png # 官方自带的:这是原来有的这个 image:
customcover: /a/eexxaammppllee.png # 自己添加的:这是在如 /posts/custom-frontmatter/ 显示的文章头图
showcover: false # 自己添加的:这是控制 是否使用 image: 定义的图片作为文章头图,默认就是会用 image: 定义的图片作为头图
--- # 这里是 Frontmatter 的结尾
```
如果你足够细心,你会发现文章 [你是人类吗?](/posts/captcha/) 的图片在**博客主页**和**文章内部**是不同的。这也用到了自定义 Frontmatter,自己定义了不同的地方该显示什么图片。 如果你足够细心,你会发现文章 [你是人类吗?](/posts/captcha/) 的图片在**博客主页**和**文章内部**是不同的。这也用到了自定义 Frontmatter,自己定义了不同的地方该显示什么图片。
# 定义 Frontmatter # 定义 Frontmatter
@@ -100,7 +111,7 @@ const postsCollection = defineCollection({
:::CAUTION[不要照抄,除非你知道自己在做什么] :::CAUTION[不要照抄,除非你知道自己在做什么]
::: :::
```astro title="src/pages/posts/[...slug].astro" {49,52} ```astro title="src/pages/posts/[...slug].astro" {49,52,107,112}
--- ---
import path from "node:path"; import path from "node:path";
import License from "@components/misc/License.astro"; import License from "@components/misc/License.astro";
+10 -3
View File
@@ -21,10 +21,10 @@
一位住在[中华人民共和国广西壮族自治区](https://baike.baidu.com/item/%E5%B9%BF%E8%A5%BF%E5%A3%AE%E6%97%8F%E8%87%AA%E6%B2%BB%E5%8C%BA/163178)的苦逼学生。 一位住在[中华人民共和国广西壮族自治区](https://baike.baidu.com/item/%E5%B9%BF%E8%A5%BF%E5%A3%AE%E6%97%8F%E8%87%AA%E6%B2%BB%E5%8C%BA/163178)的苦逼学生。
## 爱好 ## 爱好
玩游戏、写代码、写博客(也许吧),哦,还有读书。只会一点 [Python](https://baike.baidu.com/item/Python/407313),初学者罢了。 玩游戏、写代码、写博客,哦,还有读书。只会一点 [Python](https://baike.baidu.com/item/Python/407313),初学者罢了。
## 联系方式 ## 联系方式
电子邮箱:[1709301095@qq.com](mailto:1709301095@qq.com) 或 [W1709301095@gmail.com](mailto:W1709301095@gmail.com) 电子邮箱:[1709301095@qq.com](mailto:1709301095@qq.com) 或 [admin@adclosenn.top](mailto:admin@adclosenn.top)
Discordhttps://discord.com/users/1068060784300658688 Discordhttps://discord.com/users/1068060784300658688
--- ---
@@ -39,10 +39,17 @@ Discordhttps://discord.com/users/1068060784300658688
## 统计信息 ## 统计信息
使用的是自托管( [Netlify](https://www.netlify.com) + [Neon](https://neon.com))的 [Umami](https://umami.is) 。具体可查看 [手把手自托管 Umami 使用的是自托管( [Netlify](https://www.netlify.com) + [Neon](https://neon.com))的 [Umami](https://umami.is) 。具体可查看 [手把手自托管 Umami
](/posts/umami/) ](/posts/umami/)
## 音乐
使用的是 [网易云音乐外链播放器(iframe 插件)](https://music.163.com/#/outchain/2/2608813264/) 。
--- ---
# 2025/8/14
用上了大佬插件 [@rehypejs/rehype-external-links](https://www.npmjs.com/package/rehype-external-links) ,这个插件可以让仅 Markdown 文件里面定义的链接以 `target="_blank` 的形式构建。也就是通过这个插件构建出来的超链接,点击后是通过新标签页打开的。而原来原版是直接在博客里,通过覆盖你正在阅读的文章来打开链接。
可以试试点这两个链接进行比对: [更改后](https://www.bing.com) &nbsp;|&nbsp; <a href="https://www.bing.com">更改前</a>
# 2025/8/10 # 2025/8/10
~~1145141919**810**~~ ~~1145141919**810**~~
::github{repo="carbon-app/carbon"} ::github{repo="carbon-app/carbon"}