Commit 99a399c7 authored by 刘燕芳's avatar 刘燕芳

save

parent f079fd08
...@@ -122,30 +122,28 @@ chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => { ...@@ -122,30 +122,28 @@ chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
result_sendResponse = true result_sendResponse = true
return return
} }
// let cnaui: any = await getCookies('https://*.mmstat.com', 'cnaui') // chrome.tabs.query(
// console.log('cookie', 'https://.mmstat.com', cnaui.value) // {
// userId = cnaui.value // url: [tbIssueUrl],
chrome.tabs.query( // },
{ // async function (tabs) {
url: [tbIssueUrl], // console.log('query tabs', tabs,tab)
}, // let complete_tabs: any = []
async function (tabs) { // if (tabs.length) {
console.log('tabs', tabs,tab) // complete_tabs = tabs.filter((item) => item.status === 'complete')
let complete_tabs: any = [] // }
if (tabs.length) { // console.log('complete_tabs', complete_tabs)
complete_tabs = tabs.filter((item) => item.status === 'complete') // if (!complete_tabs.length) {
} // taIssueId = await createTab(tbIssueUrl)
console.log('complete_tabs', complete_tabs) // }
if (!complete_tabs.length) { // }
taIssueId = await createTab(tbIssueUrl) // )
}
}
)
let tuDe1 = decodeURI(userNickCookie.value) let tuDe1 = decodeURI(userNickCookie.value)
let tuDe2 = unescape(tuDe1.replace(/\\(u[0-9a-fA-F]{4})/gm, '%$1')) let tuDe2 = unescape(tuDe1.replace(/\\(u[0-9a-fA-F]{4})/gm, '%$1'))
if (tuDe2.indexOf(':') != -1) tuDe2 = tuDe2.split(':')[0] if (tuDe2.indexOf(':') != -1) tuDe2 = tuDe2.split(':')[0]
let createUrl = isTm(tuDe2) ? tmIssueUrl : tbIssueUrl let createUrl = isTm(tuDe2) ? tmIssueUrl : tbIssueUrl
let tabId = await createTab(createUrl) let tabId = await createTab(createUrl)
taIssueId = tabId
monitoringRemoveTabId.set(tabId, tuDe2) monitoringRemoveTabId.set(tabId, tuDe2)
} }
...@@ -173,7 +171,7 @@ chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => { ...@@ -173,7 +171,7 @@ chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
result_sendResponse = true result_sendResponse = true
} }
} }
if (monitoringRemoveTabId.has(tab.id)) { if (monitoringRemoveTabId.has(tab.id)&&tab.url&&tab.url!==tbIssueUrl) {
let id: any = tab.id let id: any = tab.id
chrome.tabs.remove(id) chrome.tabs.remove(id)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment