mirror of
https://github.com/browseros-ai/BrowserOS.git
synced 2026-05-13 23:53:25 +00:00
* feat: select text and pass to sidepanel * fix: lint issues * fix: persist selection across tabs * fix: review comments * fix: change when the selection is cleared * feat: sanitize url
15 lines
387 B
TypeScript
15 lines
387 B
TypeScript
import { storage } from '@wxt-dev/storage'
|
|
|
|
export interface SelectedTextData {
|
|
text: string
|
|
pageUrl: string
|
|
pageTitle: string
|
|
tabId: number
|
|
timestamp: number
|
|
}
|
|
|
|
/** Map of tabId → selected text. Each tab's selection is independent. */
|
|
export const selectedTextStorage = storage.defineItem<
|
|
Record<string, SelectedTextData>
|
|
>('local:selectedTextMap', { defaultValue: {} })
|