diff --git a/README.md b/README.md index a71eb63..7ce1772 100644 --- a/README.md +++ b/README.md @@ -183,4 +183,4 @@ https://www.code-box.fun/ ![img](https://raw.githubusercontent.com/027xiguapi/code-box/main/public/wx/qrcode_wx.jpg) -![u_wx](https://raw.githubusercontent.com/027xiguapi/code-box/blob/main/public/wx/u_wx.jpg) +![u_wx](https://github.com/027xiguapi/code-box/blob/main/public/wx/u_wx.jpg) diff --git a/README_EN.md b/README_EN.md index a8c50ed..10a3a2f 100644 --- a/README_EN.md +++ b/README_EN.md @@ -181,4 +181,4 @@ Directly download and install: ![img](https://raw.githubusercontent.com/027xiguapi/code-box/main/public/wx/qrcode_wx.jpg) -![img](https://raw.githubusercontent.com/027xiguapi/code-box/main/public/wx/u_wx.jpg) \ No newline at end of file +![img](https://github.com/027xiguapi/code-box/blob/main/public/wx/u_wx.jpg) \ No newline at end of file diff --git a/component/options/weixin.tsx b/component/options/weixin.tsx index 2258001..d16e28b 100644 --- a/component/options/weixin.tsx +++ b/component/options/weixin.tsx @@ -1,3 +1,7 @@ +import { DownloadOutlined, StarTwoTone } from "@ant-design/icons" + +import { sendToContentScript } from "@plasmohq/messaging" + import CssCode from "~component/items/cssCode" import DownloadHtml from "~component/items/downloadHtml" import DownloadImages from "~component/items/downloadImages" @@ -8,6 +12,12 @@ import ShowTag from "~component/items/showTag" import { i18n } from "~tools" export default function Weixin() { + async function getThumbMedia() { + sendToContentScript({ + name: `weixin-getThumbMedia` + }) + } + return (
{i18n("weixinConfig")} @@ -18,6 +28,13 @@ export default function Weixin() { +
+ + + {i18n("getThumbMedia")} + + +
) } diff --git a/contents/weixin.tsx b/contents/weixin.tsx index 9a4b9f3..1320a7a 100644 --- a/contents/weixin.tsx +++ b/contents/weixin.tsx @@ -64,6 +64,12 @@ const PlasmoOverlay: FC = ({ anchor }) => { if (req.name == "weixin-downloadImages") { await downloadImages(req.body?.onProgress) } + if (req.name == "weixin-getThumbMedia") { + const thumbMediaUrl = document.querySelector( + 'meta[property="og:image"]' + ).content + thumbMediaUrl && window.open(thumbMediaUrl) + } }) async function downloadImages( diff --git a/contents/zhihu.tsx b/contents/zhihu.tsx index f95da10..0b1f219 100644 --- a/contents/zhihu.tsx +++ b/contents/zhihu.tsx @@ -21,7 +21,7 @@ import { Print } from "~utils/print" import Turndown from "~utils/turndown" export const config: PlasmoCSConfig = { - matches: ["https://*.zhihu.com/*"] + matches: ["https://*.zhihu.com/p/*"] } const turndownService = Turndown() diff --git a/locales/en/messages.json b/locales/en/messages.json index 669fe7f..1e489c9 100644 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -193,5 +193,8 @@ }, "fullPageScreenshot": { "message": "Full Page Screenshot" + }, + "getThumbMedia": { + "message": "get Thumb Media" } } \ No newline at end of file diff --git a/locales/zh_CN/messages.json b/locales/zh_CN/messages.json index c437411..31f9f70 100644 --- a/locales/zh_CN/messages.json +++ b/locales/zh_CN/messages.json @@ -196,5 +196,8 @@ }, "fullPageScreenshot": { "message": "全页面截图" + }, + "getThumbMedia": { + "message": "获取封面" } } \ No newline at end of file diff --git a/package.json b/package.json index ffeb95b..f9a7390 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-box", "displayName": "__MSG_extensionName__", - "version": "1.0.8", + "version": "1.0.9", "description": "__MSG_extensionDescription__", "author": "027xiguapi. <458813868@qq.com>", "scripts": { diff --git a/public/en/1400x560.jpg b/public/en/1400x560.jpg new file mode 100644 index 0000000..7fa325c Binary files /dev/null and b/public/en/1400x560.jpg differ diff --git a/public/en/440x280.jpg b/public/en/440x280.jpg new file mode 100644 index 0000000..832116d Binary files /dev/null and b/public/en/440x280.jpg differ diff --git a/public/index.html b/public/index.html index 89598b6..9fa7998 100644 --- a/public/index.html +++ b/public/index.html @@ -23,16 +23,22 @@ width: 20%; } p { - font-size: 4em; + font-size: 2em; color: #000; font-family: fantasy; } + div { + font-size: 1em; + color: #666; + font-family: fantasy; + }
logo -

codebox-一键复制代码/下载文章

+

codebox

+
One-click Code Copying/Downloading Articles
\ No newline at end of file diff --git a/public/1400x560.png b/public/zh/1400x560.png similarity index 100% rename from public/1400x560.png rename to public/zh/1400x560.png diff --git a/public/440x280.png b/public/zh/440x280.png similarity index 100% rename from public/440x280.png rename to public/zh/440x280.png