From 030b7888f8b867f05b73c8d0c187094deeacec0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Fri, 19 Apr 2024 12:36:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E5=BC=BA=E4=BE=9D=E8=B5=96=E4=BA=8E?= =?UTF-8?q?=E7=AF=A1=E6=94=B9=E7=8C=B4=E8=84=9A=E6=9C=AC=EF=BC=8C=E4=B9=9F?= =?UTF-8?q?=E8=83=BD=E8=BF=90=E8=A1=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- github/monkey.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/github/monkey.js b/github/monkey.js index 8be4f44..8df2511 100644 --- a/github/monkey.js +++ b/github/monkey.js @@ -12,7 +12,7 @@ * @sourceURL https://github.com/XIU2/UserScript/blob/master/GithubEnhanced-High-Speed-Download.user.js */ document.addEventListener("DOMContentLoaded", () => { - const DS_init = window.__ds_global__['DS_init'] + const DS_init = (window.__ds_global__ || {})['DS_init'] if (typeof DS_init === 'function') { console.log("ds_github_monkey_2.5.20: do DS_init") DS_init({"name":"Github 增强 - 高速下载","icon":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAACEUExURUxpcRgWFhsYGBgWFhcWFh8WFhoYGBgWFiUlJRcVFRkWFhgVFRgWFhgVFRsWFhgWFigeHhkWFv////////////r6+h4eHv///xcVFfLx8SMhIUNCQpSTk/r6+jY0NCknJ97e3ru7u+fn51BOTsPCwqGgoISDg6empmpoaK2srNDQ0FhXV3eXcCcAAAAXdFJOUwCBIZXMGP70BuRH2Ze/LpIMUunHkpQR34sfygAAAVpJREFUOMt1U+magjAMDAVb5BDU3W25b9T1/d9vaYpQKDs/rF9nSNJkArDA9ezQZ8wPbc8FE6eAiQUsOO1o19JolFibKCdHGHC0IJezOMD5snx/yE+KOYYr42fPSufSZyazqDoseTPw4lGJNOu6LBXVUPBG3lqYAOv/5ZwnNUfUifzBt8gkgfgINmjxOpgqUA147QWNaocLniqq3QsSVbQHNp45N/BAwoYQz9oUJEiE4GMGfoBSMj5gjeWRIMMqleD/CAzUHFqTLyjOA5zjNnwa4UCEZ2YK3khEcBXHjVBtEFeIZ6+NxYbPqWp1DLKV42t6Ujn2ydyiPi9nX0TTNAkVVZ/gozsl6FbrktkwaVvL2TRK0C8Ca7Hck7f5OBT6FFbLATkL2ugV0tm0RLM9fedDvhWstl8Wp9AFDjFX7yOY/lJrv8AkYuz7fuP8dv9izCYH+x3/LBnj9fYPBTpJDNzX+7cAAAAASUVORK5CYII="}); @@ -20,17 +20,17 @@ document.addEventListener("DOMContentLoaded", () => { console.log("ds_github_2.5.20: has no DS_init") } - if (!(window.__ds_global__.GM_getValue || (() => true))("ds_enabled", true)) { + if (!((window.__ds_global__ || {}).GM_getValue || (() => true))("ds_enabled", true)) { console.log("ds_github_monkey_2.5.20: disabled") return } - const GM_registerMenuCommand = window.__ds_global__['GM_registerMenuCommand'] || (() => {}); - const GM_unregisterMenuCommand = window.__ds_global__['GM_unregisterMenuCommand'] || (() => {}); - const GM_openInTab = window.__ds_global__['GM_openInTab'] || (() => {}); - const GM_getValue = window.__ds_global__['GM_getValue'] || (() => {}); - const GM_setValue = window.__ds_global__['GM_setValue'] || (() => {}); - const GM_notification = window.__ds_global__['GM_notification'] || (() => {}); + const GM_registerMenuCommand = (window.__ds_global__ || {})['GM_registerMenuCommand'] || (() => {}); + const GM_unregisterMenuCommand = (window.__ds_global__ || {})['GM_unregisterMenuCommand'] || (() => {}); + const GM_openInTab = (window.__ds_global__ || {})['GM_openInTab'] || (() => {}); + const GM_getValue = (window.__ds_global__ || {})['GM_getValue'] || (() => {}); + const GM_setValue = (window.__ds_global__ || {})['GM_setValue'] || (() => {}); + const GM_notification = (window.__ds_global__ || {})['GM_notification'] || (() => {}); (function() { 'use strict';