various fixes
This commit is contained in:
@@ -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 += '\n';
|
||||
showStatus('Screenshot attached', true);
|
||||
showStatus('Full-page screenshot attached', true);
|
||||
} catch (e) {
|
||||
showStatus('Screenshot failed: ' + e.message, false);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user