210 lines
5.3 KiB
HTML
210 lines
5.3 KiB
HTML
<!doctype html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<title>雪球 Cookie 复制</title>
|
|
<style>
|
|
body {
|
|
font: 13px/1.5 -apple-system, "Segoe UI", "PingFang SC", sans-serif;
|
|
margin: 0;
|
|
padding: 12px 14px;
|
|
width: 380px;
|
|
background: #fafbfc;
|
|
color: #1f2328;
|
|
}
|
|
h1 {
|
|
font-size: 14px;
|
|
margin: 0 0 8px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
h1::before {
|
|
content: "❄";
|
|
color: #2563eb;
|
|
}
|
|
.row {
|
|
margin-bottom: 8px;
|
|
}
|
|
.row label {
|
|
font-size: 11px;
|
|
color: #57606a;
|
|
margin-bottom: 3px;
|
|
display: block;
|
|
}
|
|
.val {
|
|
font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
|
|
font-size: 11px;
|
|
padding: 5px 7px;
|
|
background: #f6f8fa;
|
|
border: 1px solid #d0d7de;
|
|
border-radius: 5px;
|
|
word-break: break-all;
|
|
max-height: 60px;
|
|
overflow: auto;
|
|
}
|
|
.val.empty {
|
|
color: #b91c1c;
|
|
background: #fef2f2;
|
|
border-color: #fecaca;
|
|
}
|
|
textarea.val {
|
|
width: 100%;
|
|
box-sizing: border-box;
|
|
resize: vertical;
|
|
min-height: 38px;
|
|
}
|
|
.btn-row {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 6px;
|
|
margin-top: 4px;
|
|
}
|
|
.btn-row.full {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
button {
|
|
padding: 7px 10px;
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
background: #2563eb;
|
|
color: #fff;
|
|
border: 0;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
white-space: nowrap;
|
|
}
|
|
button.secondary {
|
|
background: #fff;
|
|
color: #1f2328;
|
|
border: 1px solid #d0d7de;
|
|
}
|
|
button:disabled {
|
|
background: #94a3b8;
|
|
border-color: #94a3b8;
|
|
cursor: not-allowed;
|
|
}
|
|
#msg {
|
|
margin-top: 8px;
|
|
padding: 6px 8px;
|
|
font-size: 11px;
|
|
border-radius: 5px;
|
|
display: none;
|
|
word-break: break-all;
|
|
white-space: pre-wrap;
|
|
}
|
|
#msg.ok {
|
|
background: #ecfdf5;
|
|
color: #047857;
|
|
display: block;
|
|
}
|
|
#msg.err {
|
|
background: #fef2f2;
|
|
color: #b91c1c;
|
|
display: block;
|
|
}
|
|
#msg.info {
|
|
background: #eff6ff;
|
|
color: #1d4ed8;
|
|
display: block;
|
|
}
|
|
.hint {
|
|
font-size: 11px;
|
|
color: #6b7280;
|
|
margin-top: 8px;
|
|
line-height: 1.5;
|
|
}
|
|
.hint a {
|
|
color: #2563eb;
|
|
text-decoration: none;
|
|
}
|
|
hr {
|
|
border: 0;
|
|
border-top: 1px solid #e5e7eb;
|
|
margin: 10px 0;
|
|
}
|
|
#debug {
|
|
font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
|
|
font-size: 10px;
|
|
line-height: 1.45;
|
|
color: #4b5563;
|
|
background: #f9fafb;
|
|
border: 1px solid #e5e7eb;
|
|
border-radius: 5px;
|
|
padding: 6px 8px;
|
|
margin-top: 8px;
|
|
white-space: pre-wrap;
|
|
word-break: break-all;
|
|
max-height: 180px;
|
|
overflow: auto;
|
|
}
|
|
details > summary {
|
|
cursor: pointer;
|
|
font-size: 11px;
|
|
color: #6b7280;
|
|
margin-top: 6px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>雪球 Cookie 复制</h1>
|
|
|
|
<div class="row">
|
|
<label>xq_a_token</label>
|
|
<div id="xq-val" class="val empty">未读取</div>
|
|
</div>
|
|
<div class="row">
|
|
<label>u</label>
|
|
<div id="u-val" class="val empty">未读取</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<label>组合字符串</label>
|
|
<textarea id="combined-val" class="val" readonly>未读取</textarea>
|
|
</div>
|
|
|
|
<div class="btn-row full">
|
|
<button id="copy-combined">复制组合字符串</button>
|
|
</div>
|
|
<div class="btn-row">
|
|
<button id="copy-env" class="secondary">复制 .env 行</button>
|
|
<button id="copy-xq" class="secondary">仅 xq_a_token</button>
|
|
</div>
|
|
<div class="btn-row full">
|
|
<button id="reload-btn" class="secondary">🔄 重新读取</button>
|
|
</div>
|
|
|
|
<div id="msg"></div>
|
|
|
|
<details>
|
|
<summary>调试信息(点开看)</summary>
|
|
<div id="debug">加载中…</div>
|
|
</details>
|
|
|
|
<details>
|
|
<summary>手动粘贴(兜底)</summary>
|
|
<p style="font-size: 11px; color: #6b7280; margin: 6px 0;">
|
|
如果自动读不到:打开 xueqiu.com 页面 → F12 → Network → 任意请求 → Request Headers → 复制 <code>Cookie</code> 字段整行 → 粘到下面 → 点「提取」。
|
|
</p>
|
|
<textarea
|
|
id="manual-textarea"
|
|
class="val"
|
|
style="width: 100%; box-sizing: border-box; min-height: 60px; font-size: 11px;"
|
|
placeholder="xq_a_token=xxx; u=yyy; device_id=zzz; ..."
|
|
></textarea>
|
|
<button id="use-manual" class="secondary" style="margin-top: 6px;">从粘贴内容提取</button>
|
|
</details>
|
|
|
|
<hr />
|
|
|
|
<div class="hint">
|
|
用法:<br />
|
|
1) 在 Chrome 登录过 <a href="https://xueqiu.com/" target="_blank">xueqiu.com</a>(一次即可)<br />
|
|
2) 打开此弹窗 → 选格式 → 一键复制<br />
|
|
3) 粘到 <code>.env</code> / dashboard / 任何你需要的地方
|
|
</div>
|
|
|
|
<script src="popup.js"></script>
|
|
</body>
|
|
</html>
|