mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-08-31 04:58:09 +00:00
fix(extension): remove webNavigation permission
This commit is contained in:
@@ -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] }
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user