feat(ext): option to control all tabs

This commit is contained in:
Simon
2026-03-27 20:18:13 +08:00
parent 2322d6c46b
commit e1fede1194
5 changed files with 61 additions and 10 deletions

View File

@@ -114,6 +114,19 @@ export function handleTabControlMessage(
return true // async response
}
case 'get_window_tabs': {
debug('get_window_tabs')
chrome.tabs
.query({ currentWindow: true })
.then((tabs) => {
sendResponse({ success: true, tabs })
})
.catch((error) => {
sendResponse({ error: error instanceof Error ? error.message : String(error) })
})
return true
}
default:
sendResponse({ error: `Unknown action: ${action}` })
return