Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35284395b3 | ||
|
|
38f5c400d6 |
No files matched your search
@@ -1,5 +1,19 @@
|
||||
# Changelog
|
||||
|
||||
## v2.2.0 (2026-10-23)
|
||||
|
||||
- ✨ **主界面停靠浏览器右侧(Side Panel)**:点扩展图标直接在浏览器右缘打开/收起侧栏,常驻停靠、随浏览器窗口走,可拖拽调宽
|
||||
- 移除旧的气泡弹窗形态(default_popup → side_panel);保留「窗口」按钮用于桌面级右侧独立窗口
|
||||
- 兼容:侧栏上下文中「窗口」按钮不再误关自己
|
||||
|
||||
---
|
||||
|
||||
## v2.1.5 (2026-10-23)
|
||||
|
||||
- ✨ 「窗口」按钮打开的独立窗口**固定停靠屏幕右侧**:贴右缘、占满可用高度(排除任务栏)、宽 440
|
||||
|
||||
---
|
||||
|
||||
## v2.1.4 (2026-10-23)
|
||||
|
||||
- ✨ 设置内容全部**移出抽屉、内联到首页**(同步桥接状态/Token/地址、悬浮按钮、自建站点、历史入口直接可见)
|
||||
|
||||
@@ -2,15 +2,17 @@
|
||||
"manifest_version": 3,
|
||||
"name": "文章同步助手",
|
||||
"description": "一键同步文章到知乎、头条、掘金等 20+ 平台,支持公众号多账号保持在线",
|
||||
"version": "2.1.4",
|
||||
"version": "2.2.0",
|
||||
"icons": {
|
||||
"16": "assets/icon-16.png",
|
||||
"48": "assets/icon-48.png",
|
||||
"128": "assets/icon-128.png"
|
||||
},
|
||||
"action": {
|
||||
"default_icon": "assets/icon-48.png",
|
||||
"default_popup": "src/popup/index.html"
|
||||
"default_icon": "assets/icon-48.png"
|
||||
},
|
||||
"side_panel": {
|
||||
"default_path": "src/popup/index.html"
|
||||
},
|
||||
"permissions": [
|
||||
"storage",
|
||||
@@ -22,7 +24,8 @@
|
||||
"tabs",
|
||||
"alarms",
|
||||
"contextMenus",
|
||||
"downloads"
|
||||
"downloads",
|
||||
"sidePanel"
|
||||
],
|
||||
"host_permissions": [
|
||||
"http://*/*",
|
||||
@@ -96,4 +99,4 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@wechatsync/extension",
|
||||
"version": "2.1.4",
|
||||
"version": "2.2.0",
|
||||
"private": true,
|
||||
"description": "微信公众号同步助手 Chrome 扩展",
|
||||
"type": "module",
|
||||
@@ -40,4 +40,4 @@
|
||||
"vite": "^5.0.10",
|
||||
"vitest": "^2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1147,6 +1147,25 @@ function getCmsIcon(type: string): string {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 扩展主界面停靠浏览器右侧(sidePanel)
|
||||
* - 点扩展图标直接在浏览器右缘打开/收起侧栏(常驻停靠,随浏览器窗口走)
|
||||
* - setPanelBehavior 不可用时回退:图标点击手动开侧栏
|
||||
*/
|
||||
chrome.sidePanel
|
||||
.setPanelBehavior({ openPanelOnActionClick: true })
|
||||
.catch(() => {
|
||||
chrome.action.onClicked.addListener(async (tab) => {
|
||||
if (!tab.id) return
|
||||
try {
|
||||
await chrome.sidePanel.setOptions({ tabId: tab.id, enabled: true })
|
||||
await chrome.sidePanel.open({ tabId: tab.id })
|
||||
} catch {
|
||||
/* 忽略:无侧栏权限的老环境 */
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
/**
|
||||
* 处理右键菜单点击
|
||||
*/
|
||||
|
||||
@@ -102,14 +102,27 @@ export function HomeNew() {
|
||||
}
|
||||
|
||||
// 在独立窗口打开扩展(popup 点外部会自动关闭,独立窗口可常驻保持打开)
|
||||
// 固定停靠屏幕右侧:贴右缘、占满可用高度(排除任务栏),宽度 440 便于阅读
|
||||
const handleOpenInWindow = async () => {
|
||||
const width = 440
|
||||
const height = screen.availHeight
|
||||
const left = Math.max(0, screen.availWidth - width)
|
||||
await chrome.windows.create({
|
||||
url: chrome.runtime.getURL('src/popup/index.html'),
|
||||
type: 'popup',
|
||||
width: 420,
|
||||
height: 720,
|
||||
width,
|
||||
height,
|
||||
left,
|
||||
top: 0,
|
||||
focused: true,
|
||||
})
|
||||
window.close()
|
||||
// 仅在扩展气泡上下文才关自己;侧栏(sidePanel)里 window.close 无效
|
||||
try {
|
||||
const ctx: any = await (chrome.runtime as any).getContext?.()
|
||||
if (ctx?.contextType === 'POPUP') window.close()
|
||||
} catch {
|
||||
/* 忽略 */
|
||||
}
|
||||
}
|
||||
|
||||
// Start sync with rate-limit check
|
||||
@@ -165,7 +178,7 @@ export function HomeNew() {
|
||||
<button
|
||||
onClick={handleOpenInWindow}
|
||||
className="flex flex-col items-center gap-0.5 px-2 py-1 rounded-lg hover:bg-muted transition-colors"
|
||||
title="在独立窗口打开(常驻保持,不随点击关闭)"
|
||||
title="在右侧独立窗口打开(贴屏幕右缘常驻,不随点击关闭)"
|
||||
>
|
||||
<Maximize2 className="w-3.5 h-3.5" />
|
||||
<span className="text-[10px] text-muted-foreground leading-none">窗口</span>
|
||||
|
||||
Reference in new issue
Block a user