这是一个 Chrome 浏览器扩展,旨在帮助用户快速将 Draw.io 的 XML 代码或 Mermaid 代码在 diagrams.net (即 Draw.io) 中打开并预览。特别优化了在 ChatGPT、Claude、Gemini、DeepSeek、Perplexity 以及国产AI(Kimi、豆包、千问、混元、小米、IMA、智谱)等网站上的使用体验。
- 右键菜单支持:在受支持的 AI 网站中选中 Draw.io XML 或 Mermaid 文本,右键点击 "Open in Draw.io" 即可直接打开预览。
- 智能代码块检测:在支持的 AI 网站上,自动识别包含 Draw.io XML 或 Mermaid 的代码块。
- 一键打开按钮:在检测到的 XML / Mermaid 代码块旁自动注入悬浮的 "Open in Draw.io" 按钮,无需手动复制粘贴。
- 流式生成支持:完美支持 AI 对话的流式输出,在内容生成过程中或完成后自动添加操作按钮。
- Mermaid 原生支持:无需转换,直接将 Mermaid 文本通过 diagrams.net 打开预览。
- 广泛的AI平台支持:支持国内外主流AI对话平台。
直接访问 Chrome 应用商店安装:https://chromewebstore.google.com/detail/drawio-quick-launcher/bmohimdhaihjldphihhjnmojbobpekgo
- 下载本项目源代码到本地。
- 打开 Chrome 浏览器,在地址栏输入
chrome://extensions/并回车。 - 打开右上角的 "开发者模式" (Developer mode) 开关。
- 点击左上角的 "加载已解压的扩展程序" (Load unpacked) 按钮。
- 选择包含
manifest.json文件的项目根目录。
- ChatGPT - https://chatgpt.com
- Claude - https://claude.ai
- Google Gemini - https://gemini.google.com / https://aistudio.google.com
- DeepSeek - https://chat.deepseek.com
- Perplexity - https://www.perplexity.ai
- Kimi(月之暗面) - https://www.kimi.com
- 豆包(字节跳动) - https://www.doubao.com
- 通义千问(阿里) - https://www.qianwen.com / https://chat.qwen.ai
- 混元(腾讯) - https://hunyuan.tencent.com
- 小米大模型 - https://aistudio.xiaomimimo.com
- IMA(腾讯) - https://ima.qq.com
- 智谱(清华KEG) - https://chatglm.cn / https://chat.glmdl.cn
- 在受支持的 AI 网站中选中一段 Draw.io XML 或 Mermaid 代码:
- Draw.io 通常以
<mxfile ...或<mxGraphModel ...开头。 - Mermaid 常见以
graph TD,flowchart,sequenceDiagram等关键词开头。
- Draw.io 通常以
- 点击鼠标右键。
- 选择上下文菜单中的 "Open in Draw.io"。
- 扩展会自动识别格式,在新标签页中通过 diagrams.net 打开预览。
- 在任意支持的 AI 网站(ChatGPT、Claude、Gemini、DeepSeek、Kimi、豆包、千问、智谱等)页面中。
- 当 AI 生成了 Draw.io 的 XML 或 Mermaid 代码块时,代码块区域(通常在右上角或顶部)会自动出现一个橙色的 "Open in Draw.io" 按钮。
- 直接点击该按钮即可预览图表。
- 权限:
contextMenus: 用于添加右键菜单项。- 站点权限: 仅用于在特定 AI 网站上注入辅助按钮脚本。
- 隐私:扩展会在本地扫描代码块以识别图表;只有用户主动点击后,图表内容才会编码到
app.diagrams.netURL 的 Fragment(#后部分)中。Fragment 不会随 HTTP 请求发送给服务器。详见 隐私政策。
- 新增对智谱(chatglm.cn)的支持
- 优化按钮注入逻辑
- 新增对 7 个国产 AI 平台的支持:Kimi、豆包、通义千问(双域名)、混元、小米大模型、IMA
- 优化按钮注入逻辑,适配各平台的DOM结构差异
- 新增对 DeepSeek、Perplexity 的支持
- 初始版本,支持 ChatGPT、Claude、Gemini
如有问题或建议,欢迎在 GitHub Issues 中提出。
项目运行时不依赖第三方库。开发检查需要 Node.js 20.12.0 或更高版本:
npm test
npm run check