(tabId: number)
| 77 | } |
| 78 | |
| 79 | async function getPageCapture(tabId: number): Promise<PageCapturePayload> { |
| 80 | const [response] = await chrome.scripting.executeScript<PageCapturePayload>({ |
| 81 | func: getPageCaptureFromPage, |
| 82 | target: { tabId }, |
| 83 | }) |
| 84 | |
| 85 | if (!response.result) { |
| 86 | throw new Error('Could not read the active page.') |
| 87 | } |
| 88 | |
| 89 | return response.result |
| 90 | } |
| 91 | |
| 92 | async function notify(title: string, message: string): Promise<void> { |
| 93 | await chrome.action.setBadgeText({ |