various fixes

This commit is contained in:
2026-09-24 08:28:43 -07:00
parent 92883d63f5
commit 720ffca099
7 changed files with 119 additions and 6 deletions

View File

@@ -68,16 +68,23 @@
noteEl.value = v + link + '\n';
captureBtn.disabled = true;
showStatus('Capturing full page…', true);
try {
const dataUrl = await browser.tabs.captureVisibleTab({ format: 'png' });
const tabs = await browser.tabs.query({ active: true, currentWindow: true });
if (!tabs.length || tabs[0].id == null) { showStatus('No active tab ', false); return; }
const shot = await browser.runtime.sendMessage({
kind: 'capture_full_page',
tabId: tabs[0].id,
windowId: tabs[0].windowId,
});
const r = await browser.runtime.sendMessage({
kind: 'upload_attachment',
dataUrl: dataUrl,
dataUrl: shot.dataUrl,
filename: 'page.png',
username: userEl.value,
});
noteEl.value += '![Screenshot](' + r.url + ')\n';
showStatus('Screenshot attached', true);
showStatus('Full-page screenshot attached', true);
} catch (e) {
showStatus('Screenshot failed: ' + e.message, false);
} finally {