- 决策文档:架构总览 / 代码源与构建平台选型 / CNB构建落地方案 / EdgeOne双区域 / Gitee / 阿里云ESA / 精简方案 - CNB 构建骨架:deploy/Dockerfile、bin/linux/hugo (84MB,linux/amd64 extended 0.128.2,供 CNB 容器 COPY 用) - scripts/setup-cnb-remotes.sh:双远端切换(CNB 主仓 + GitHub 备份) - .gitignore 补 .workbuddy/(工作数据不入库)
52 lines
2.3 KiB
HTML
52 lines
2.3 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>人机验证 · 真实评论区预览</title>
|
|
<style>
|
|
*{box-sizing:border-box}
|
|
body{margin:0;background:#0f1115;color:#e8eaed;font:14px/1.6 -apple-system,'PingFang SC','Microsoft YaHei',sans-serif}
|
|
.bar{position:sticky;top:0;z-index:9;background:#171a20;border-bottom:1px solid rgba(255,255,255,.08);
|
|
padding:10px 14px;display:flex;gap:8px;flex-wrap:wrap;align-items:center}
|
|
.bar b{font-size:14px;margin-right:6px}
|
|
.bar .hint{font-size:12px;color:#98a2b3;margin-left:auto}
|
|
button{font:inherit;font-size:13px;padding:6px 12px;border-radius:8px;cursor:pointer;
|
|
border:1px solid rgba(255,255,255,.16);background:transparent;color:#e8eaed}
|
|
button:hover{border-color:#07c160}
|
|
button.primary{background:#07c160;border-color:#07c160;color:#fff}
|
|
iframe{width:100%;height:calc(100vh - 58px);border:0;background:#fff;display:block}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="bar">
|
|
<b>真实评论区预览</b>
|
|
<button class="primary" onclick="call('run')">跑一次真实验证</button>
|
|
<button onclick="call('none')">正常读者(无控件)</button>
|
|
<button onclick="call('click')">需要点一下</button>
|
|
<button onclick="call('captcha')">需要图形验证码</button>
|
|
<span class="hint">控件出现在评论输入框上方(iframe 里是真的 Artalk 评论区)</span>
|
|
</div>
|
|
<iframe id="fr" src="/comment.html"></iframe>
|
|
|
|
<script>
|
|
/* 同源 iframe:直接调用评论页里暴露的 window.__humanCheck 钩子。
|
|
- run:真实跑一遍(领挑战 → 浏览器算 PoW → 交信号 → 服务端发通行证)
|
|
- none/click/captcha:只看控件外观,不请求接口
|
|
今天 D1 额度已用尽,评论列表会加载失败(红字报错),但输入框和控件位置照样能看到。 */
|
|
function api() {
|
|
var w = document.getElementById('fr').contentWindow;
|
|
return w && w.__humanCheck;
|
|
}
|
|
function call(kind) {
|
|
var h = api();
|
|
if (!h) { alert('评论区还没加载完,等一两秒再点'); return; }
|
|
if (kind === 'run') { h.drop(); h.run(false); }
|
|
else if (kind === 'none') { h.drop(); }
|
|
else if (kind === 'click') { h.drop(); h.showClick(); }
|
|
else if (kind === 'captcha') { h.drop(); h.showCaptcha(); }
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|