adding resetDebugger

This commit is contained in:
Tommy D. Rossi
2025-11-16 10:01:52 +01:00
parent 25aa09471b
commit b7de13986d
+11
View File
@@ -23,6 +23,17 @@ const useExtensionStore = create<ExtensionState>(() => ({
errorText: undefined, errorText: undefined,
})); }));
async function resetDebugger() {
let targets = await chrome.debugger.getTargets()
targets = targets.filter(x => x.tabId && x.attached)
console.log(`found ${targets.length} existing debugger targets. detaching them before background script starts`)
console.log(targets)
for (const target of targets) {
await chrome.debugger.detach({tabId: target.tabId})
}
}
resetDebugger()
const icons = { const icons = {
connected: { connected: {
path: { path: {