Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
ruitu-fahuoyi-exension
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
廖健文
ruitu-fahuoyi-exension
Commits
99a399c7
Commit
99a399c7
authored
Mar 21, 2024
by
刘燕芳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save
parent
f079fd08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
20 deletions
+18
-20
index.ts
src/background/index.ts
+18
-20
No files found.
src/background/index.ts
View file @
99a399c7
...
@@ -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
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment