feat(ext): handling page reload/redirect/close

This commit is contained in:
Simon
2026-01-21 18:46:50 +08:00
parent 570c79623b
commit 3fea74faa9
5 changed files with 250 additions and 18 deletions
@@ -132,6 +132,16 @@ export interface AgentCommandProtocol {
'agent:configure': (config: { apiKey: string; baseURL: string; model: string }) => void
}
// ============================================================================
// Content Script Query Protocol: ContentScript -> Background
// Used by ContentScript to query Background state
// ============================================================================
export interface ContentScriptQueryProtocol {
/** Check if there's an active task for this tab, returns true if mask should be shown */
'content:shouldShowMask': () => boolean
}
// ============================================================================
// Event Protocol: Background -> SidePanel
// Used by Background to push updates to SidePanel
@@ -165,3 +175,9 @@ export const agentCommands = defineExtensionMessaging<AgentCommandProtocol>()
* Background sends, SidePanel receives
*/
export const agentEvents = defineExtensionMessaging<AgentEventProtocol>()
/**
* Content script query messaging
* ContentScript sends, Background receives
*/
export const contentScriptQuery = defineExtensionMessaging<ContentScriptQueryProtocol>()