Skip to content

Commit aa0e8c3

Browse files
committed
호환성 처리
1 parent 4ce9b41 commit aa0e8c3

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

background.js

+15-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
const normalTabDetectKey = '&lost_ark_sign_normal_tab=1'
22

3-
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
4-
const { status, url } = changeInfo
5-
6-
if (!url) return;
7-
if (status !== 'loading') return;
8-
if (url.indexOf('https://accounts.google.com') !== 0) return;
9-
if (!url.includes('onstove.com')) return;
10-
if (url.includes(normalTabDetectKey)) return;
3+
const processUrl = (url, tabId) => {
4+
if (!url) return
5+
if (url.indexOf('https://accounts.google.com') !== 0) return
6+
if (!url.includes('onstove.com')) return
7+
if (url.includes(normalTabDetectKey)) return
118

129
chrome.windows.create({
1310
incognito: false,
1411
url: url + normalTabDetectKey
1512
})
1613

17-
chrome.tabs.remove(tab.id)
14+
chrome.tabs.remove(tabId)
15+
}
16+
17+
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
18+
if (changeInfo.status !== 'loading') return
19+
processUrl(changeInfo.url, tab.id)
20+
})
21+
22+
chrome.tabs.onCreated.addListener((tab) => {
23+
processUrl(tab.pendingUrl || '', tab.id)
1824
})

manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "LOST ARK 구글 자동 로그인 (NO 시크릿)",
33
"description": "시크릿 창으로 열리는 소셜 로그인을 일반 창으로 열어서 자동 로그인을 사용할 수 있도록 해드립니다.",
4-
"version": "1.3",
4+
"version": "1.4",
55
"manifest_version": 3,
66
"background": {
77
"service_worker": "background.js"

0 commit comments

Comments
 (0)