feat: 扩展优化重构
Some checks failed
Extension Build & Release / build (push) Failing after 56s

This commit is contained in:
zs
2026-03-03 02:19:14 +08:00
parent c686d81d30
commit 1d17ac03e0
15 changed files with 904 additions and 692 deletions

View File

@@ -103,3 +103,15 @@ chrome.runtime.onMessage.addListener((message: { type: string; payload?: any },
}
return true;
});
// Handle Command (Keyboard Shortcut)
chrome.commands.onCommand.addListener((command) => {
if (command === 'toggle-sidebar') {
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
const activeTab = tabs[0];
if (activeTab?.id) {
chrome.tabs.sendMessage(activeTab.id, { type: 'TOGGLE_SIDEBAR' });
}
});
}
});