Skip to content

Commit 127f8d3

Browse files
committed
Destructured chrome listener params
1 parent d3c4080 commit 127f8d3

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

chatgpt-auto-continue/chromium/extension/service-worker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ chrome.runtime.onMessage.addListener(async ({ action }) => {
3535
const chatgptTab = new URL(activeTab.url).hostname == 'chatgpt.com' ? activeTab
3636
: await chrome.tabs.create({ url: 'https://chatgpt.com/' })
3737
if (activeTab != chatgptTab) await new Promise(resolve => // after new tab loads
38-
chrome.tabs.onUpdated.addListener(function loadedListener(tabId, changeInfo) {
39-
if (tabId == chatgptTab.id && changeInfo.status == 'complete') {
38+
chrome.tabs.onUpdated.addListener(function loadedListener(tabId, { status }) {
39+
if (tabId == chatgptTab.id && status == 'complete') {
4040
chrome.tabs.onUpdated.removeListener(loadedListener) ; setTimeout(resolve, 1500)
4141
}}))
4242
chrome.tabs.sendMessage(chatgptTab.id, { action: 'showAbout' })

chatgpt-auto-continue/firefox/extension/background.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ chrome.runtime.onMessage.addListener(async ({ action }) => {
3636
const chatgptTab = new URL(activeTab.url).hostname == 'chatgpt.com' ? activeTab
3737
: await chrome.tabs.create({ url: chatgptURL })
3838
if (activeTab != chatgptTab) await new Promise(resolve => // after new tab loads
39-
chrome.tabs.onUpdated.addListener(function loadedListener(tabId, changeInfo) {
40-
if (tabId == chatgptTab.id && changeInfo.status == 'complete') {
39+
chrome.tabs.onUpdated.addListener(function loadedListener(tabId, { status }) {
40+
if (tabId == chatgptTab.id && status == 'complete') {
4141
chrome.tabs.onUpdated.removeListener(loadedListener) ; setTimeout(resolve, 1500)
4242
}}))
4343
chrome.tabs.sendMessage(chatgptTab.id, { action: 'showAbout' })

chatgpt-infinity/chromium/extension/service-worker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ chrome.runtime.onMessage.addListener(async ({ action }) => {
3838
const chatgptTab = new URL(activeTab.url).hostname == 'chatgpt.com' ? activeTab
3939
: await chrome.tabs.create({ url: 'https://chatgpt.com' })
4040
if (activeTab != chatgptTab) await new Promise(resolve => // after new tab loads
41-
chrome.tabs.onUpdated.addListener(function loadedListener(tabId, changeInfo) {
42-
if (tabId == chatgptTab.id && changeInfo.status == 'complete') {
41+
chrome.tabs.onUpdated.addListener(function loadedListener(tabId, { status }) {
42+
if (tabId == chatgptTab.id && status == 'complete') {
4343
chrome.tabs.onUpdated.removeListener(loadedListener) ; setTimeout(resolve, 1500)
4444
}}))
4545
chrome.tabs.sendMessage(chatgptTab.id, { action: 'showAbout' })

chatgpt-infinity/firefox/extension/background.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ chrome.runtime.onMessage.addListener(async ({ action }) => {
3939
const chatgptTab = new URL(activeTab.url).hostname == 'chatgpt.com' ? activeTab
4040
: await chrome.tabs.create({ url: chatgptURL })
4141
if (activeTab != chatgptTab) await new Promise(resolve => // after new tab loads
42-
chrome.tabs.onUpdated.addListener(function loadedListener(tabId, changeInfo) {
43-
if (tabId == chatgptTab.id && changeInfo.status == 'complete') {
42+
chrome.tabs.onUpdated.addListener(function loadedListener(tabId, { status }) {
43+
if (tabId == chatgptTab.id && status == 'complete') {
4444
chrome.tabs.onUpdated.removeListener(loadedListener) ; setTimeout(resolve, 1500)
4545
}}))
4646
chrome.tabs.sendMessage(chatgptTab.id, { action: 'showAbout' })

chatgpt-widescreen/chromium/extension/service-worker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ chrome.runtime.onMessage.addListener(async ({ action }) => {
5656
url: sitesEnabled[Math.floor(Math.random() * sitesEnabled.length)] || aiHomeURLs[0] })
5757
})
5858
if (activeTab != aiTab) await new Promise(resolve => // after new tab loads
59-
chrome.tabs.onUpdated.addListener(function loadedListener(tabId, info) {
60-
if (tabId == aiTab.id && info.status == 'complete') {
59+
chrome.tabs.onUpdated.addListener(function loadedListener(tabId, { status }) {
60+
if (tabId == aiTab.id && status == 'complete') {
6161
chrome.tabs.onUpdated.removeListener(loadedListener) ; setTimeout(resolve, 1500)
6262
}}))
6363
chrome.tabs.sendMessage(aiTab.id, { action: 'showAbout' })

chatgpt-widescreen/firefox/extension/background.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ chrome.runtime.onMessage.addListener(async ({ action }) => {
5353
url: sitesEnabled[Math.floor(Math.random() * sitesEnabled.length)] || aiHomeURLs[0] })
5454
})
5555
if (activeTab != aiTab) await new Promise(resolve => // after new tab loads
56-
chrome.tabs.onUpdated.addListener(function loadedListener(tabId, info) {
57-
if (tabId == aiTab.id && info.status == 'complete') {
56+
chrome.tabs.onUpdated.addListener(function loadedListener(tabId, { status }) {
57+
if (tabId == aiTab.id && status == 'complete') {
5858
chrome.tabs.onUpdated.removeListener(loadedListener) ; setTimeout(resolve, 1500)
5959
}}))
6060
chrome.tabs.sendMessage(aiTab.id, { action: 'showAbout' })

deepseek-omnibox/chromium/extension/service-worker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const deepseekChatURL = 'https://chat.deepseek.com'
1010
})()
1111

1212
function tabIsLoaded(tabId) {
13-
return new Promise(resolve => chrome.tabs.onUpdated.addListener(function loadedListener(id, info) {
14-
if (id == tabId && info.status == 'complete') {
13+
return new Promise(resolve => chrome.tabs.onUpdated.addListener(function loadedListener(id, { status }) {
14+
if (id == tabId && status == 'complete') {
1515
chrome.tabs.onUpdated.removeListener(loadedListener) ; setTimeout(resolve, 500) }
1616
}))
1717
}

deepseek-omnibox/firefox/extension/background.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const deepseekChatURL = 'https://chat.deepseek.com'
1010
})()
1111

1212
function tabIsLoaded(tabId) {
13-
return new Promise(resolve => chrome.tabs.onUpdated.addListener(function loadedListener(id, info) {
14-
if (id == tabId && info.status == 'complete') {
13+
return new Promise(resolve => chrome.tabs.onUpdated.addListener(function loadedListener(id, { status }) {
14+
if (id == tabId && status == 'complete') {
1515
chrome.tabs.onUpdated.removeListener(loadedListener) ; setTimeout(resolve, 500) }
1616
}))
1717
}
@@ -25,9 +25,9 @@ chrome.action.onClicked.addListener(async () => {
2525
})
2626

2727
// Query DeepSeek on omnibox query submitted
28-
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
29-
if (changeInfo.status == 'complete' && tab.url.startsWith(deepseekChatURL)) {
30-
const query = new URL(tab.url).searchParams.get('q')
28+
chrome.tabs.onUpdated.addListener((tabId, { status }, { url }) => {
29+
if (status == 'complete' && url.startsWith(deepseekChatURL)) {
30+
const query = new URL(url).searchParams.get('q')
3131
if (query) chrome.tabs.sendMessage(tabId, query)
3232
}
3333
})

0 commit comments

Comments
 (0)