mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-09-04 15:05:20 +00:00
fix(extension): remove webNavigation permission
This commit is contained in:
+2
-18
@@ -2190,7 +2190,7 @@ function setPageApiSeekEnabled(enabled) {
|
||||
}
|
||||
|
||||
async function deactivateMediaFrameMonitors(tabId) {
|
||||
const targets = await listMediaFrameScriptTargets(chrome, tabId);
|
||||
const targets = listMediaFrameScriptTargets(tabId);
|
||||
await Promise.all(targets.map(async target => {
|
||||
const documentId = target.documentIds?.[0];
|
||||
const frameId = target.frameIds?.[0];
|
||||
@@ -2293,7 +2293,7 @@ function createTargetActivationSupersededError() {
|
||||
}
|
||||
|
||||
async function injectMediaFrameMonitors(tabId, contentTarget) {
|
||||
const targets = await listMediaFrameScriptTargets(chrome, tabId);
|
||||
const targets = listMediaFrameScriptTargets(tabId);
|
||||
let injectedCount = 0;
|
||||
await Promise.all(targets.map(async target => {
|
||||
try {
|
||||
@@ -2923,22 +2923,6 @@ if (chrome.permissions?.onAdded?.addListener) {
|
||||
});
|
||||
}
|
||||
|
||||
if (chrome.webNavigation?.onCompleted?.addListener) {
|
||||
chrome.webNavigation.onCompleted.addListener((details) => {
|
||||
ensureState().then(async () => {
|
||||
const tabId = normalizeTabId(details?.tabId);
|
||||
const frameId = normalizeFrameId(details?.frameId);
|
||||
if (tabId === null
|
||||
|| tabId !== normalizeTabId(currentTabId)
|
||||
|| frameId === 0
|
||||
|| (frameId !== normalizeFrameId(currentTargetFrameId) && currentTargetHasVideo)) {
|
||||
return;
|
||||
}
|
||||
await refreshCurrentMediaTarget(tabId, { queueIfRunning: true });
|
||||
}).catch(error => addLog(`Media frame navigation refresh failed: ${error.message}`, 'warn'));
|
||||
});
|
||||
}
|
||||
|
||||
if (chrome.tabs?.onRemoved?.addListener) {
|
||||
chrome.tabs.onRemoved.addListener((removedTabId) => {
|
||||
ensureState().then(async () => {
|
||||
|
||||
Reference in New Issue
Block a user