fix(extension): remove webNavigation permission

This commit is contained in:
Timo
2026-08-17 18:41:40 +02:00
parent 76adafd1e4
commit 4d7897028b
7 changed files with 30 additions and 86 deletions
+5 -2
View File
@@ -58,8 +58,11 @@ async function getFrameMonitorState(context, extensionId, pageUrl, frameUrlPart)
return withExtensionPage(context, extensionId, page => page.evaluate(async ({ pageUrl, frameUrlPart }) => {
const [tab] = await chrome.tabs.query({ url: pageUrl });
if (!tab) throw new Error(`no tab matched ${pageUrl}`);
const frames = await chrome.webNavigation.getAllFrames({ tabId: tab.id });
const frame = frames.find(candidate => candidate.url.includes(frameUrlPart));
const frameResults = await chrome.scripting.executeScript({
target: { tabId: tab.id, allFrames: true },
func: () => ({ href: location.href, cleanup: typeof window.__koalaMediaFrameMonitorCleanup })
});
const frame = frameResults.find(candidate => candidate.result?.href.includes(frameUrlPart));
if (!frame) throw new Error(`no frame matched ${frameUrlPart}`);
const target = frame.documentId
? { tabId: tab.id, documentIds: [frame.documentId] }
+2 -1
View File
@@ -1,4 +1,5 @@
import { defineConfig } from '@playwright/test';
import { fileURLToPath } from 'node:url';
const PORT = Number(process.env.KOALA_E2E_PORT || 4173);
@@ -25,7 +26,7 @@ export default defineConfig({
}
},
webServer: {
command: `node ${new URL('./fixture-server.mjs', import.meta.url).pathname} ${PORT}`,
command: `node "${fileURLToPath(new URL('./fixture-server.mjs', import.meta.url))}" ${PORT}`,
url: `http://localhost:${PORT}/pages/simple-player.html`,
reuseExistingServer: !process.env.CI,
stdout: 'ignore',