Initial Context Extractor: extension + Playwright/Camoufox package
CI / Lint + tests (push) Has been cancelled
CI / Lint + tests (push) Has been cancelled
Ship a shared markdown/prompt core used by a Brave/Chrome MV3 extension and a Python automation API, with pytest coverage, CI, and packaging smoke.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
// background.js — Context Extractor service worker
|
||||
// Persists the selector chosen via the in-page element picker so the popup
|
||||
// can pre-fill it the next time it opens.
|
||||
|
||||
chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
|
||||
if (!msg || !msg.type) return false;
|
||||
|
||||
if (msg.type === "PICKER_SELECTED") {
|
||||
const selector = msg.selector || "";
|
||||
chrome.storage.session
|
||||
.set({ pickerSelector: selector })
|
||||
.then(() => sendResponse({ ok: true }))
|
||||
.catch((err) => sendResponse({ ok: false, error: String(err) }));
|
||||
return true; // async response
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
Reference in New Issue
Block a user