共计 1492 个字符,预计需要花费 4 分钟才能阅读完成。
<?php
$title = "xxxxxxxx";
$targetURL = "https://www.s36.bet";
$luodietURL = "https://tl.s36.click";
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><?php echo $title; ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<script>
// 最终要打开的网址
const targetURL = "<?php echo $targetURL; ?>";
// 兜底网址
const luodietURL = "<?php echo $luodietURL; ?>";
// Android intent
function getAndroidIntent(url) {const m = url.match(/^https?:\/\/([^\/]+)(\/.*)?$/);
if (!m) return url;
const host = m[1];
const path = m[2] || "";
const scheme = url.startsWith("https") ? "https" : "http";
return `intent://${host}${path}#Intent;scheme=${scheme};package=com.android.chrome;S.browser_fallback_url=${encodeURIComponent(luodietURL)};end`;
}
document.addEventListener("DOMContentLoaded", () => {
const ua = navigator.userAgent;
// =============== Android ===============
if (/Android/i.test(ua)) {
// 使用 intent,并设置 fallback URL
window.location.href = getAndroidIntent(targetURL);
// 双重兜底:如果 intent 也失败了
setTimeout(() => {
// 检查页面是否还有焦点(说明没跳走)if (document.hasFocus?.() || document.visibilityState === 'visible') {window.location.href = luodietURL;}
}, 1500);
return;
}
// =============== iOS ===============
if (/iPad|iPhone|iPod/i.test(ua)) {const chromeURL = targetURL.replace("https://", "googlechromes://").replace("http://", "googlechrome://");
// 先设置兜底跳转到 luodietURL
const fallbackTimer = setTimeout(() => {window.location.href = luodietURL;}, 500);
// 尝试打开 Chrome
window.location = chromeURL;
return;
}
// =============== 其它设备(电脑等)直接跳转 ===============
window.location.href = targetURL;
});
</script>
</body>
</html>
正文完
发表至: 未分类
2025-11-18