Switch back attachTab method temporarily (to avoid warning)
This commit is contained in:
parent
10dc61fcdc
commit
4c2ff0d1ae
2 changed files with 16 additions and 6 deletions
|
|
@ -1,12 +1,22 @@
|
|||
import attachDebugger from '../utils/attachDebugger'
|
||||
import attachDebugger from './attachDebugger'
|
||||
|
||||
const attachTab = (e: any) => {
|
||||
const attachTab = (tabId: number) => {
|
||||
chrome.debugger.getTargets((tabs) => {
|
||||
const currentTab = tabs.find((obj) => obj.tabId === e.tabId)
|
||||
const currentTab = tabs.find((obj) => obj.tabId === tabId)
|
||||
if (!currentTab?.attached) {
|
||||
attachDebugger(e.tabId)
|
||||
attachDebugger(tabId)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
chrome.webNavigation.onBeforeNavigate.addListener(attachTab)
|
||||
chrome.tabs.onCreated.addListener((tab) => {
|
||||
tab.id && attachDebugger(tab.id)
|
||||
})
|
||||
|
||||
chrome.tabs.onActivated.addListener((tab) => {
|
||||
attachTab(tab.tabId)
|
||||
})
|
||||
|
||||
chrome.tabs.onUpdated.addListener((tabId) => {
|
||||
attachTab(tabId)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"description": "__MSG_extDesc__",
|
||||
"author": "__MSG_extName__",
|
||||
"default_locale": "en",
|
||||
"permissions": ["storage", "debugger", "webNavigation"],
|
||||
"permissions": ["storage", "debugger"],
|
||||
"background": { "service_worker": "background.bundle.js" },
|
||||
"action": {
|
||||
"default_popup": "popup.html",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue