()
| 227 | } |
| 228 | |
| 229 | function updatePreview(): void { |
| 230 | if (!previewInput || !currentPayload) { |
| 231 | return |
| 232 | } |
| 233 | |
| 234 | if (activeTarget === 'http') { |
| 235 | previewInput.value = currentPayload.url |
| 236 | updatePreviewLabel() |
| 237 | return |
| 238 | } |
| 239 | |
| 240 | if (activeTarget === 'notes') { |
| 241 | previewInput.value |
| 242 | = currentPayload.selectedMarkdown |
| 243 | || currentPayload.selectedText |
| 244 | || currentPayload.pageMarkdown |
| 245 | || currentPayload.pageText |
| 246 | || currentPayload.pageTitle |
| 247 | updatePreviewLabel() |
| 248 | return |
| 249 | } |
| 250 | |
| 251 | previewInput.value |
| 252 | = currentPayload.selectedText || 'Select text on the page to save a snippet.' |
| 253 | updatePreviewLabel() |
| 254 | } |
| 255 | |
| 256 | function canCaptureCurrentTarget(): boolean { |
| 257 | if (!currentPayload) { |
no test coverage detected