Skip to content

Commit

Permalink
Update UA detection
Browse files Browse the repository at this point in the history
  • Loading branch information
hifocus committed Apr 27, 2024
1 parent 16a09aa commit 9969317
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion assets/bundles/function.main.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions assets/js/function.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ else {
}

// General UserAgent verify rules
if (navigator.userAgent.match(/Alipay/i)) {
if (navigator.userAgent.includes('Alipay')) {
if (noalipay === true) {
alert("AliPay is not set up by the admin \n 管理员没有设置支付宝");
if (location.href.substr(location.href.lastIndexOf('#') + 1) == "showqrcode" && !selected) document.getElementById('showqrcode').style.display = "none";
Expand All @@ -192,7 +192,7 @@ if (navigator.userAgent.match(/Alipay/i)) {
removal();
}
}
else if (navigator.userAgent.match(/MicroMessenger\//i)) {
else if (navigator.userAgent.includes('MicroMessenger')) {
if (nowechat === true) {
alert("WeChat Pay is not set up by the admin \n 管理员没有设置微信支付");
if (location.href.substr(location.href.lastIndexOf('#') + 1) == "showqrcode" && !selected) document.getElementById('showqrcode').style.display = "none";
Expand All @@ -206,6 +206,7 @@ else if (navigator.userAgent.match(/MicroMessenger\//i)) {
var finaltitle = "";
var finalsub = "";
removal();
console.log("%c WeChat Pay Detected ", "color: green");
}
}
else {
Expand Down

0 comments on commit 9969317

Please sign in to comment.