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

save

parent f079fd08
......@@ -122,30 +122,28 @@ chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
result_sendResponse = true
return
}
// let cnaui: any = await getCookies('https://*.mmstat.com', 'cnaui')
// console.log('cookie', 'https://.mmstat.com', cnaui.value)
// userId = cnaui.value
chrome.tabs.query(
{
url: [tbIssueUrl],
},
async function (tabs) {
console.log('tabs', tabs,tab)
let complete_tabs: any = []
if (tabs.length) {
complete_tabs = tabs.filter((item) => item.status === 'complete')
}
console.log('complete_tabs', complete_tabs)
if (!complete_tabs.length) {
taIssueId = await createTab(tbIssueUrl)
}
}
)
// chrome.tabs.query(
// {
// url: [tbIssueUrl],
// },
// async function (tabs) {
// console.log('query tabs', tabs,tab)
// let complete_tabs: any = []
// if (tabs.length) {
// complete_tabs = tabs.filter((item) => item.status === 'complete')
// }
// console.log('complete_tabs', complete_tabs)
// if (!complete_tabs.length) {
// taIssueId = await createTab(tbIssueUrl)
// }
// }
// )
let tuDe1 = decodeURI(userNickCookie.value)
let tuDe2 = unescape(tuDe1.replace(/\\(u[0-9a-fA-F]{4})/gm, '%$1'))
if (tuDe2.indexOf(':') != -1) tuDe2 = tuDe2.split(':')[0]
let createUrl = isTm(tuDe2) ? tmIssueUrl : tbIssueUrl
let tabId = await createTab(createUrl)
taIssueId = tabId
monitoringRemoveTabId.set(tabId, tuDe2)
}
......@@ -173,7 +171,7 @@ chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
result_sendResponse = true
}
}
if (monitoringRemoveTabId.has(tab.id)) {
if (monitoringRemoveTabId.has(tab.id)&&tab.url&&tab.url!==tbIssueUrl) {
let id: any = tab.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