Skip to content
This repository was archived by the owner on Feb 14, 2022. It is now read-only.

Commit 3f9d14a

Browse files
authored
Merge pull request #10 from cgiosy/master
Replace deprecated method
2 parents b9cc444 + 25072ec commit 3f9d14a

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

options_logged_info.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ const URL = 'https://api.solved.ac/validate_token.php'
44

55
const logout = () => {
66
chrome.storage.local.remove('token', () => {
7-
chrome.tabs.getSelected(null, ({ id }) => {
7+
chrome.tabs.query({
8+
active: true,
9+
currentWindow: true
10+
}, ({ id }) => {
811
const code = 'window.location.reload();'
912
chrome.tabs.executeScript(id, { code })
1013
})

options_login.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ const validate = () => {
1717
const { token } = data
1818
console.log(token)
1919
chrome.storage.local.set({ token }, () => {
20-
chrome.tabs.getSelected(null, ({ id }) => {
20+
chrome.tabs.query({
21+
active: true,
22+
currentWindow: true
23+
}, ({ id }) => {
2124
const code = 'window.location.reload();'
2225
chrome.tabs.executeScript(id, { code })
2326
})

0 commit comments

Comments
 (0)