()
| 337 | } |
| 338 | //===============================================获取远程通知======================================== |
| 339 | async function getNotice() { |
| 340 | try { |
| 341 | const urls = [ |
| 342 | "https://gitee.com/ohhhooh/jd_haoyangmao/raw/master/Notice.json", |
| 343 | |
| 344 | ]; |
| 345 | let notice = null; |
| 346 | for (const url of urls) { |
| 347 | const options = { url, headers: { "User-Agent": "" }, }; |
| 348 | const result = await httpRequest(options); |
| 349 | if (result && "notice" in result) { |
| 350 | notice = result.notice.replace(/\\n/g, "\n"); |
| 351 | break; |
| 352 | } |
| 353 | } |
| 354 | if (notice) { $.DoubleLog(notice); } |
| 355 | } catch (e) { |
| 356 | console.log(e); |
| 357 | } |
| 358 | } |
| 359 | //==============================================获取远程版本================================================= |
| 360 | function getVersion(scriptUrl, timeout = 3 * 1000) { |
| 361 | return new Promise((resolve) => { |
nothing calls this directly
no test coverage detected