import depoHelper from "../func/module/depoHelper"; import travelHelper from "../func/module/travelHelper"; import priceWatcherHandle from "../func/module/priceWatcherHandle"; import WuhuBase from "./WuhuBase"; import WuhuConfig from "./WuhuConfig"; import CompanyHelper from "./action/CompanyHelper"; import AttackHelper from "./action/AttackHelper"; import SidebarHelper from "./action/SidebarHelper"; import CommonUtils from "./utils/CommonUtils"; import Log from "./Log"; import FetchUtils from "./utils/FetchUtils"; export class Common extends WuhuBase { className = 'Common'; public resolve(mainMethod) { let glob = Common.glob; // 价格监控 priceWatcherHandle(glob.isPDA, glob.PDA_APIKey); // 啤酒提醒 if (WuhuConfig.get('_15Alarm')) glob.beer.start(); SidebarHelper.getInstance(); /** * 解决一直转圈(加载中)的问题 * All('script[src*="google"]') * All('#gtm_tag') * All('script[src*="chat/gonline"]') * All('head script[nonce]') */ if (document.readyState === 'interactive' && WuhuConfig.get('SolveGoogleScriptPendingIssue')) { window.stop(); document.open(); document.addEventListener('readystatechange', function readyStateChangeHandler() { Log.info('document.readyState', document.readyState); if (document.readyState === 'complete') { document.removeEventListener('readystatechange', readyStateChangeHandler); mainMethod(); throw new Error('页面已重载'); } }); FetchUtils.getInstance().fetchText(window.location.href).then(resp => { let removed = resp; [ /