# InsightFlow Chrome Extension 一键将网页内容导入 InsightFlow 知识库的 Chrome 扩展。 ## 功能特性 - 📄 **保存整个页面** - 自动提取正文内容并保存 - ✏️ **保存选中内容** - 只保存您选中的文本 - 🔗 **保存链接** - 快速保存网页链接 - 🔄 **自动同步** - 剪辑后自动同步到服务器 - 📎 **浮动按钮** - 页面右下角快速访问按钮 - 🎯 **智能提取** - 自动识别正文,过滤广告和导航 ## 安装方法 ### 开发者模式安装 1. 打开 Chrome 浏览器,进入 `chrome://extensions/` 2. 开启右上角的"开发者模式" 3. 点击"加载已解压的扩展程序" 4. 选择 `chrome-extension` 文件夹 ### 配置 1. 点击扩展图标,选择"设置" 2. 填写您的 InsightFlow 服务器地址 3. 输入 Chrome 扩展令牌(从 InsightFlow 插件管理页面获取) 4. 点击"保存设置" 5. 点击"测试连接"验证配置 ## 使用方法 ### 方式一:扩展图标 1. 点击浏览器工具栏上的 InsightFlow 图标 2. 选择"保存整个页面"或"保存选中内容" ### 方式二:右键菜单 1. 在网页任意位置右键 2. 选择"Clip page to InsightFlow"或"Clip selection to InsightFlow" ### 方式三:浮动按钮 1. 在页面右下角点击 📎 按钮 2. 快速保存当前页面 ### 方式四:快捷键 - `Ctrl+Shift+S` (Windows/Linux) - `Cmd+Shift+S` (Mac) ## 文件结构 ``` chrome-extension/ ├── manifest.json # 扩展配置 ├── background.js # 后台脚本 ├── content.js # 内容脚本 ├── content.css # 内容样式 ├── popup.html # 弹出窗口 ├── popup.js # 弹出窗口脚本 ├── options.html # 设置页面 ├── options.js # 设置页面脚本 └── icons/ # 图标文件夹 ├── icon16.png ├── icon48.png └── icon128.png ``` ## 开发 ### 本地开发 1. 修改代码后,在 `chrome://extensions/` 页面点击刷新按钮 2. 查看背景页控制台:扩展卡片 > 背景页 > 控制台 ### 打包发布 1. 确保所有文件已保存 2. 在 `chrome://extensions/` 页面点击"打包扩展程序" 3. 选择 `chrome-extension` 文件夹 4. 生成 `.crx` 和 `.pem` 文件 ## API 集成 扩展通过以下 API 与 InsightFlow 服务器通信: ### 导入网页内容 ``` POST /api/v1/plugins/chrome/import Content-Type: application/json X-API-Key: {token} { "token": "if_ext_xxx", "url": "https://example.com/article", "title": "文章标题", "content": "正文内容...", "html_content": "..." } ``` ### 健康检查 ``` GET /api/v1/health ``` ## 隐私说明 - 扩展仅在您主动点击时收集网页内容 - 所有数据存储在您的 InsightFlow 服务器上 - 不会收集或发送任何个人信息到第三方 ## 许可证 MIT License