Browse Source

将安装了脚本的检测转移到原版网页内

tags/v31.1
枫谷剑仙 3 years ago
parent
commit
695c41771d
3 changed files with 7 additions and 5 deletions
  1. +1
    -2
      doc/link-helper.js
  2. +4
    -1
      script.js
  3. +2
    -2
      service-worker.js

+ 1
- 2
doc/link-helper.js View File

@@ -4,7 +4,7 @@
// @name:zh-HK 龍圖急速陣型鏈接助手
// @name:zh-TW 龍圖急速陣型鏈接助手
// @namespace http://www.mapaler.com/
// @version 1.0.2
// @version 1.0.3
// @description Helps obtain team data from external cross-domain servers such as PADDB
// @description:zh-CN 帮助获取 PADDB 等外部跨域服务器的队伍分享数据
// @description:zh-HK 幫助獲取 PADDB 等外部跨域服務器的隊伍分享數據
@@ -42,5 +42,4 @@
GM_xmlhttpRequest(options);
});
};
document.body.classList.add("external-link-support");
})();

+ 4
- 1
script.js View File

@@ -1932,6 +1932,10 @@ function initialize() {
qrCodeFrame.show();
};
qrCodeFrame.initialize = function(){
//如果检测到功能
if (btnExternalSupport?.asyncGM_xmlhttpRequest) {
document.body.classList.add("external-link-support");
}
const qrSaveBox = this.content.saveBox;
const qrReadBox = this.content.readBox;
qrReadBox.info.show('');
@@ -2246,7 +2250,6 @@ function initialize() {
const paddbSaveOrUpload = document.querySelector("#paddb-save-or-upload-team");
paddbSaveOrUpload.onclick = async function(){
this.disabled = true;
const btnExternalSupport = document.body.querySelector("#external-support");
if (!btnExternalSupport?.asyncGM_xmlhttpRequest) {
alert(localTranslating.link_read_message.need_user_script);
return;


+ 2
- 2
service-worker.js View File

@@ -8091,7 +8091,7 @@ const cachesMap = new Map([
],
[
"script.js",
"910c1850224619f8c574087b1b5e0e8f"
"bc145197afe8fe38b0090b2930a69e15"
],
[
"solo.html",
@@ -8367,7 +8367,7 @@ const cachesMap = new Map([
],
[
"doc/index.html",
"b76648dd229ac25cfe97e670cf925ba9"
"16d7e69c328a122a2d6a2e14251c5f9a"
],
[
"doc/images/player-bind-box.webp",


Loading…
Cancel
Save