From 41f5aa19a3320ba3e5335e2ebe975cb01ea1c741 Mon Sep 17 00:00:00 2001 From: schmeeve Date: Fri, 25 Sep 2026 15:04:09 -0700 Subject: [PATCH] fix capture --- browser-extension/background.js | 6 +++--- browser-extension/manifest.json | 8 ++++---- browser-extension/options.html | 4 ++-- browser-extension/popup.js | 2 +- static/app.js | 15 +++++++++------ 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/browser-extension/background.js b/browser-extension/background.js index e5554bd..593c0a1 100644 --- a/browser-extension/background.js +++ b/browser-extension/background.js @@ -115,7 +115,7 @@ async function captureFullPage(msg) { const windowId = msg.windowId; if (tabId == null) throw new Error('No active tab'); - const dims = await browser.tabs.sendMessage(tabId, { kind: 'get_viewport' }); + const dims = await browser.tabs.sendMessage(tabId, { kind: 'get_viewport' }, { frameId: 0 }); const vw = dims.viewportWidth || 1; const vh = dims.viewportHeight || 1; const ph = dims.pageHeight || vh; @@ -129,13 +129,13 @@ async function captureFullPage(msg) { const parts = []; for (let i = 0; i < sliceCount; i++) { const y = Math.max(0, Math.min(i * vh, ph - vh)); - await browser.tabs.sendMessage(tabId, { kind: 'scroll_to', y: y }); + await browser.tabs.sendMessage(tabId, { kind: 'scroll_to', y: y }, { frameId: 0 }); await sleep(250); const dataUrl = await browser.tabs.captureVisibleTab(windowId, { format: 'png' }); parts.push({ dataUrl: dataUrl, y: y }); } - await browser.tabs.sendMessage(tabId, { kind: 'scroll_to', y: dims.scrollY || 0 }).catch(() => {}); + await browser.tabs.sendMessage(tabId, { kind: 'scroll_to', y: dims.scrollY || 0 }, { frameId: 0 }).catch(() => {}); const canvas = document.createElement('canvas'); canvas.width = Math.round(vw * dpr); diff --git a/browser-extension/manifest.json b/browser-extension/manifest.json index 65b82e3..d4ff9eb 100644 --- a/browser-extension/manifest.json +++ b/browser-extension/manifest.json @@ -1,8 +1,8 @@ { "manifest_version": 3, - "name": "quickSnote", + "name": "QUICKsnote", "version": "1.0.6", - "description": "Quick-capture a note to snotes from any page, with the selected text and page link ready to use", + "description": "QUICKsnote captures a note to snotes from any page, with the selected text and page link ready to use", "permissions": [ "storage", "activeTab" @@ -31,7 +31,7 @@ "js": [ "content.js" ], - "all_frames": true, + "all_frames": false, "run_at": "document_idle" } ], @@ -42,7 +42,7 @@ } }, "action": { - "default_title": "quickSnote", + "default_title": "QUICKsnote", "default_popup": "popup.html", "default_icon": { "48": "icons/icon-48.png", diff --git a/browser-extension/options.html b/browser-extension/options.html index 232c3a0..6cb3a6b 100644 --- a/browser-extension/options.html +++ b/browser-extension/options.html @@ -3,7 +3,7 @@ - quickSnote Options + QUICKsnote Options -

quickSnote

+

QUICKsnote

diff --git a/browser-extension/popup.js b/browser-extension/popup.js index 31ea835..f70b49e 100644 --- a/browser-extension/popup.js +++ b/browser-extension/popup.js @@ -45,7 +45,7 @@ try { const tabs = await browser.tabs.query({ active: true, currentWindow: true }); if (!tabs.length || tabs[0].id == null) return; - const ctx = await browser.tabs.sendMessage(tabs[0].id, { kind: 'get_context' }); + const ctx = await browser.tabs.sendMessage(tabs[0].id, { kind: 'get_context' }, { frameId: 0 }); if (ctx && ctx.selection && !noteEl.value) { noteEl.value = ctx.selection; } diff --git a/static/app.js b/static/app.js index ff8f455..9066454 100644 --- a/static/app.js +++ b/static/app.js @@ -193,7 +193,7 @@ function header() { el("select", { id: "user-select", class: "user-select", onchange: onUserChange }), el("button", { class: "btn primary", text: "+ New note", onclick: () => openNote(null) }), el("button", { class: "btn ghost", text: "Help", onclick: showHelp }), - el("button", { class: "btn ghost", text: "quickSnote", onclick: showTools }), + el("button", { class: "btn ghost", text: "QUICKsnote", onclick: showTools }), themeSelector(), ]); const burger = el("button", { class: "menu-toggle", title: "Menu", "aria-label": "Menu", onclick: () => menu.classList.toggle("open") }, [ @@ -218,7 +218,10 @@ function showHelp() { const wrap = el("div", { class: "editor-wrap" }, [ el("div", { class: "editor-topbar" }, [back]), el("div", { class: "help-card" }, [ - el("h1", { text: "Help" }), + el("div", { class: "tools-head" }, [ + el("img", { src: "/static/snotes-logo.png", class: "tools-logo", alt: "snotes" }), + el("h1", { text: "Help" }), + ]), el("h2", { text: "Keyboard shortcuts" }), el("table", { class: "help-table" }, [ @@ -263,10 +266,10 @@ function showTools() { const card = el("div", { class: "help-card" }, [ el("div", { class: "tools-head" }, [ - el("img", { src: "/static/snotes-logo.png", class: "tools-logo", alt: "quickSnote" }), - el("h1", { text: "Quick capture" }), + el("img", { src: "/static/snotes-logo.png", class: "tools-logo", alt: "QUICKsnote" }), + el("h1", { text: "QUICKsnote" }), ]), - el("p", { html: 'The quickSnote browser extension lets you jot a note from any page. It prefills the note with the text you\'ve selected, and a Page button inserts the current page\'s title and link.' }), + el("p", { html: 'The QUICKsnote browser extension lets you jot a note from any page. It prefills the note with the text you\'ve selected, and a Page button inserts the current page\'s title and link.' }), el("h2", { text: "Firefox" }), el("div", { class: "tools-row" }, [installBtn, extStatus]), @@ -327,7 +330,7 @@ function showTools() { installBtn.addEventListener("click", () => { if (detected) return; - if (window.InstallTrigger) InstallTrigger.install({ "quickSnote": xpiUrl }); + if (window.InstallTrigger) InstallTrigger.install({ "QUICKsnote": xpiUrl }); else window.location.href = xpiUrl; extStatus.textContent = "Installing… check toolbar for prompt"; stopPing();