From 2b80ea2669b7fb2fac14b98353691dba67c668c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=88=9A=28noham=29=C2=B2?= <100566912+NohamR@users.noreply.github.com> Date: Fri, 19 Jun 2026 14:25:12 +0200 Subject: [PATCH] Hightlight js + CSP fix --- index.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 2102147..ea679ab 100644 --- a/index.js +++ b/index.js @@ -36,7 +36,8 @@ async function discoverExtensionId(browser) { } async function extractArticle(page, readabilityPath) { - await page.addScriptTag({ path: readabilityPath }); + const readabilitySource = fs.readFileSync(readabilityPath, "utf-8"); + await page.evaluate(readabilitySource); const article = await page.evaluate(() => { const doc = document.cloneNode(true); const reader = new Readability(doc); @@ -202,8 +203,12 @@ async function main() { const contentHtml = await extractRenderedContent(readerPage, `chrome-extension://${extId}/data/reader/`); await readerPage.close(); + const highlightCss = ''; + const highlightJs = '