Skip to content

Commit

Permalink
修复一些bug
Browse files Browse the repository at this point in the history
  • Loading branch information
omegaee committed Nov 1, 2023
1 parent 3046f47 commit cae3aa8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*.crx
/*.zip
*.pem
4 changes: 2 additions & 2 deletions chrome/src/popup/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@
<button class="_btn wide h30 blue">关&emsp;&emsp;于</button>
<div class="drop-down disable" style="height: 110px; overflow: hidden;">
<div style="margin: 5px 0; padding: 2px;">
<div class="item">版本: <span class="_version">1.1.1</span></div>
<div class="item"><a class="_update" href="#">无更新</a></div>
<div class="item">版本: <span class="_version">0.0.0</span></div>
<div class="item"><a class="_update" href="#">检查中...</a></div>
<div class="item link"><a target="_blank"
href="https://github.com/omegaee/my-fingerprint">
——— Github ———
Expand Down
15 changes: 11 additions & 4 deletions chrome/src/popup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,18 +371,25 @@ const regAboutUI = function (button, elem) {
el.querySelector('._version').textContent = ver;

// is update
fetch('https://api.github.com/omegaee/my-fingerprint/releases/latest', {
let el_update = el.querySelector('._update');
fetch('https://api.github.com/repos/omegaee/my-fingerprint/releases/latest', {
method: 'GET',
})
.then(response => response.json())
.then(data => {
let latest = data.tag_name;
if(ver != latest){
let el_update = el.querySelector('._update');
if(latest == undefined){
el_update.textContent = "检查更新失败"
}else if(ver != latest){
el_update.textContent = `最新版本:${latest}(点击更新)`
el_update.href = data.html_url || '#'
}else{
el_update.textContent = "已是最新版本"
}
})
.catch(error => console.error('Error:', error));
.catch(error => {
el_update.textContent = "检查更新失败"
});
})
}

Expand Down

0 comments on commit cae3aa8

Please sign in to comment.