当前浏览器内核不兼容,请使用 Safari 浏览器访问。
点击复制
打开
(function () { if (window.top !== window.self) return; if (window.__KB_MODE !== 'ios-other') return; function init() { var gate = document.getElementById('ios-kernel-gate'); var urlEl = document.getElementById('ikg-url'); var copyBtn = document.getElementById('ikg-copy'); var openBtn = document.getElementById('ikg-open'); var hint = document.getElementById('ikg-hint'); var p = (location.pathname === '/client/home' || location.pathname === '/client/home/') ? '/' : location.pathname; var fullUrl = location.origin + p + location.search; urlEl.textContent = fullUrl; gate.hidden = false; function showHint(t) { hint.textContent = t; } copyBtn.addEventListener('click', function () { function done() { copyBtn.textContent = '已复制'; setTimeout(function () { copyBtn.textContent = '点击复制'; }, 1600); } function fallback() { var ta = document.createElement('textarea'); ta.value = fullUrl; ta.style.cssText = 'position:fixed;top:0;left:0;width:1px;height:1px;opacity:0;'; document.body.appendChild(ta); ta.focus(); ta.select(); ta.setSelectionRange(0, ta.value.length); try { document.execCommand('copy'); } catch (e) {} document.body.removeChild(ta); done(); } if (navigator.clipboard && navigator.clipboard.writeText) { navigator.clipboard.writeText(fullUrl).then(done, fallback); } else { fallback(); } showHint('已复制,打开 Safari 粘贴访问'); }); openBtn.addEventListener('click', function () { var schemeUrl = 'x-safari-https://' + location.host + location.pathname + location.search + location.hash; showHint('正在尝试唤起 Safari…'); try { location.href = schemeUrl; } catch (e) {} setTimeout(function () { if (!document.hidden) { try { window.open(schemeUrl, '_blank'); } catch (e) {} } }, 800); setTimeout(function () { if (!document.hidden) { showHint('未能自动唤起 Safari。请点「点击复制」,再手动打开 Safari 粘贴访问。'); } }, 2200); }); } if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', init, { once: true }); else init(); })();