-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from khengyun/edu@v3
Edu@v3
- Loading branch information
Showing
6 changed files
with
32 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
console.log("some thign") | ||
function check_version(data) { | ||
let local_version = version | ||
let github_version = data.tag_name.replace('v', '') | ||
|
||
console.log(github_version, local_version); | ||
|
||
if (local_version !== github_version) { | ||
let download_link = `https://github.com/khengyun/autonext/archive/refs/tags/${data.tag_name}.zip` | ||
document.getElementById("version").innerHTML = '<div style="color: crimson"> Your version is no longer supported, click <a target="_blank" href=!!!> here</a> to download the new version </div>'.replace('!!!', `${download_link}`) | ||
document.getElementById("version").style.position = 'static'; | ||
} | ||
} | ||
|
||
|
||
chrome.tabs.query({active: true, lastFocusedWindow: true}, tabs => { | ||
|
||
//call api check version | ||
let repo_api = "https://api.github.com/repos/khengyun/autonext/releases/latest"; | ||
fetch(repo_api).then(res => res.json()).then(jsonData => { | ||
|
||
check_version(jsonData) | ||
|
||
}) | ||
|
||
let url = tabs[0].url; | ||
if (!url.includes('https://fu.edunext.vn/')) { | ||
document.getElementById('container').innerHTML = '<div>Please Switch To <a href="https://fu.edunext.vn/"> EDUNEXT </a> Tab To Edit Settings</div>' | ||
document.getElementById('container').innerHTML = '<div>Please Switch To <a href="https://fu.edunext.vn"> EDUNEXT </a> Tab To Edit Settings</div>' | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +0,0 @@ | ||
|
||
|
||
|
||
chrome.action.onClicked.addListener((tab) => { | ||
|
||
console.log("some thign") | ||
chrome.tabs.query({active: true, lastFocusedWindow: true}, tabs => { | ||
let url = tabs[0].url; | ||
if (!url.includes('https://fu.edunext.vn/')) { | ||
document.getElementById('container').innerHTML = '<div>Please Switch To <a href="https://fu.edunext.vn/"> EDUNEXT </a> Tab To Edit Settings</div>' | ||
} | ||
}); | ||
}); | ||
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters