演示

https://bancn.pages.dev/

效果

image.png

image.png

原理

屏蔽CST时区(Asia/Shanghai)以及简体中文(ZH-CN)用户,更改时区或语言均可绕过屏蔽

代码

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Welcome Page</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-color: #f4f4f4;
        }
        .container {
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>Welcome to our website!</h1>
        <p>This page is accessible to all users except those in the China Standard Time zone using Simplified Chinese.</p>
    </div>

    <script>
        // Function to check the user's language and time zone
        function checkUserAccess() {
            // Get the user's preferred language
            const userLanguage = navigator.language || navigator.userLanguage;

            // Get the user's time zone
            const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;

            // Check if the user's language is zh-CN and the time zone is Asia/Shanghai
            if (userLanguage === 'zh-CN' && userTimeZone === 'Asia/Shanghai') {
                // Redirect the user to an access denied page or display a message
                document.body.innerHTML = `
					<b style="font-size:large"> 禁止访问 
					<p style="color:grey">您无法您所在的国家访问本网站</p>
					`;
				document.title = `禁止访问 `;
            }
        }

        // Run the check when the page loads
        window.onload = checkUserAccess;
    </script>
</body>
</html>