(title: string, message: string)
| 90 | } |
| 91 | |
| 92 | async function notify(title: string, message: string): Promise<void> { |
| 93 | await chrome.action.setBadgeText({ |
| 94 | text: title.startsWith('Saved') ? 'OK' : 'ERR', |
| 95 | }) |
| 96 | await chrome.action.setTitle({ title: `${title}: ${message}` }) |
| 97 | |
| 98 | setTimeout(() => { |
| 99 | void chrome.action.setBadgeText({ text: '' }) |
| 100 | }, 3000) |
| 101 | } |
| 102 | |
| 103 | function isCaptureTarget(value: string | number): value is CaptureTarget { |
| 104 | return value === 'code' || value === 'notes' || value === 'http' |