// ==UserScript== // @name 图集岛VIP-FancyBox版 // @namespace https://scriptcat.org/script-show-page/443 // @version 1.7 // @description 破解图集岛VIP // @author yyg, 253681319,LARASSR // @include /https?:\/\/(\w+\.)?tujidao\w+\.\w+/ // @grant none // @date 2022-01-14 // @require https://cdn.staticfile.org/jquery/3.6.0/jquery.min.js // @license MIT // ==/UserScript== (async function () { "use strict"; let isDebugMain = false; let fancyboxyArrIndex=0; let mainArr = [ 'https://cdn.jsdelivr.net/gh/CYqiang-sc/hello@master/main.js', 'https://cdn.staticaly.com/gh/CYqiang-sc/hello@master/main.js', 'https://greasyfork.org/scripts/447371-commonlymainfunctions/code/CommonlyMainFunctions.js?version=1066681' ]; let fancyboxyArr = [ 'https://cdn.jsdelivr.net/gh/CYqiang-sc/hello@master/fancybox.js', 'https://cdn.staticaly.com/gh/CYqiang-sc/hello@master/fancybox.js', 'https://larassr.coding.net/p/fancybox4.0/d/fancybox4/git/raw/master/fancybox4.js' ]; async function startMain_() { function log() { if (isDebugMain) { console.log.apply(this, arguments); } }; function isEmpty(param) { if (param) { var param_type = typeof (param); if (param_type == 'object') { //要判断的是【对象】或【数组】或【null】等 if (typeof (param.length) == 'undefined') { if (JSON.stringify(param) == "{}") { return true; //空值,空对象 } } else if (param.length == 0) { return true; //空值,空数组 } } else if (param_type == 'string') { //如果要过滤空格等字符 var new_param = param.trim(); if (new_param.length == 0) { //空值,例如:带有空格的字符串" "。 return true; } } else if (param_type == 'boolean') { if (!param) { return true; } } else if (param_type == 'number') { if (!param) { return true; } } return false; //非空值 } else { //空值,例如: //(1)null //(2)可能使用了js的内置的名称,例如:var name=[],这个打印类型是字符串类型。 //(3)空字符串''、""。 //(4)数字0、00等,如果可以只输入0,则需要另外判断。 return true; } } function Get_(link) { return new Promise(function (resolve) { $.get(link, data => { resolve(data); }); }); } function addScript_(statement = null, src = null, isModule = false) { let mountElement = document.getElementsByTagName('head')[0]; if (mountElement) { let script = document.createElement("script"); if (src !== null) { script.src = src; } else if (statement !== null) { script.textContent = statement; if (isModule) script.type = "module"; } return new Promise((resolve, reject) => { try { mountElement.appendChild(script); script.onerror = (e) => reject(e); script.onload = () => { resolve(); } } catch (error) { reject(error); } }); } return null; } function delayPromise(ms) { return new Promise(function (resolve) { setTimeout(resolve, ms); }); } function timeoutPromise(name, promise, ms = 1000) { let timeout = delayPromise(ms).then(function () { throw new Error(name + ': Operation timed out after ' + ms + ' ms'); }); return Promise.race([promise, timeout]); } let initialArrFunction = async function (arr) { for (let index in arr) { let data; try { data = await timeoutPromise(arr[index], Get_(arr[index])); log(data); } catch (error) { debugger log(error); timeoutPromise(arr[index], addScript_(null, arr[index])); } if (!isEmpty(data)) { addScript_(data); fancyboxyArrIndex=index; break; } } }; await initialArrFunction(mainArr); await initialArrFunction(fancyboxyArr); } console.clear(); if (isDebugMain) console.groupCollapsed('StartMain'); await startMain_(); if (isDebugMain) console.groupEnd('StartMain'); await new Promise(function (resolve) { let id = setInterval(function () { try { //打印开关 isDebug = isDebugMain; if (Fancybox4) { log("fancybox4js finished!\n"); clearInterval(id); resolve(); }; } catch (error) { log("fancybox4js isn't finished!"); } }, 100); }); var html1 = '
机构:网络美女
// //人物:Byoru
// //