feat(账号分析+工作台): 功能三自动联动生成设定卡+双向联动维护+玫瑰金配色定稿+首页数据预览/周榜优化+CDP验证脚本
- mcn-dou-analysis: 功能三产出设定后自动生成设定卡(Step7); 设定md与卡片SVG双向联动维护规则固化(06文档+03文档+SKILL.md); 浅色系配色定稿玫瑰金(#D6A3A9→#9A5563)+背景文字提亮规则; 新增06生成账号设定卡片文档+模板样例 - mcn-work-shop: 首页数据预览条/周榜预览表加宽/改名AI脚本诊断/tab切换/添加账号弹窗等优化 - 新增 cdp-*.mjs 验证脚本14个(可复用); .gitignore 忽略运行日志/截图/tmp
This commit is contained in:
1 parent
ab97842030
commit
268ce29aae
35 files changed
+2567
-117
No files matched your search
@@ -0,0 +1,36 @@
|
||||
const list = await fetch('http://localhost:9223/json').then((r) => r.json());
|
||||
const page = list.find((t) => t.type === 'page' && t.url.includes('#/rewrites'));
|
||||
const ws = new WebSocket(page.webSocketDebuggerUrl);
|
||||
let id = 0; const pending = new Map();
|
||||
const send = (method, params = {}) => new Promise((res, rej) => { const i = ++id; pending.set(i, { res, rej }); ws.send(JSON.stringify({ id: i, method, params })); });
|
||||
ws.onmessage = (e) => { const m = JSON.parse(e.data); if (m.id && pending.has(m.id)) { const p = pending.get(m.id); pending.delete(m.id); m.error ? p.rej(new Error(m.error.message)) : p.res(m.result); } };
|
||||
await new Promise((r) => (ws.onopen = r));
|
||||
const ev = async (expr) => { const r = await send('Runtime.evaluate', { expression: expr, returnByValue: true, awaitPromise: true }); if (r.exceptionDetails) return { __err: (r.exceptionDetails.exception?.description || r.exceptionDetails.text).slice(0, 300) }; return r.result.value; };
|
||||
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
||||
await send('Page.enable'); await send('Runtime.enable');
|
||||
await send('Page.reload', { ignoreCache: true });
|
||||
await sleep(2000);
|
||||
await ev(`document.querySelector('[data-detail]').click()`);
|
||||
await sleep(1200);
|
||||
// 拿 AI脚本列 body 中心坐标
|
||||
const rect = await ev(`(() => {
|
||||
const ai = [...document.querySelectorAll('.rw-stack > .rw-sec')].find((s) => s.querySelector('.rw-sec-head')?.textContent === 'AI脚本');
|
||||
const r = ai.querySelector('.rw-sec-body').getBoundingClientRect();
|
||||
return { x: Math.round(r.left + r.width / 2), y: Math.round(r.top + 200), top: Math.round(r.top), h: Math.round(r.height) };
|
||||
})()`);
|
||||
console.log('aiBody rect:', JSON.stringify(rect));
|
||||
// 真实滚轮:向下滚 6 次(每次 -300 逻辑上内容上移?deltaY 正=向下滚动)
|
||||
for (let i = 0; i < 8; i++) {
|
||||
await send('Input.dispatchMouseEvent', { type: 'mouseWheel', x: rect.x, y: rect.y, deltaX: 0, deltaY: 300 });
|
||||
await sleep(120);
|
||||
}
|
||||
await sleep(300);
|
||||
const st = await ev(`(() => {
|
||||
const secs = [...document.querySelectorAll('.rw-stack > .rw-sec')];
|
||||
const aiBody = secs.find((s) => s.querySelector('.rw-sec-head')?.textContent === 'AI脚本').querySelector('.rw-sec-body');
|
||||
const sbBody = secs.find((s) => s.querySelector('.rw-sec-head')?.textContent === 'AI分镜提示词').querySelector('.rw-sec-body');
|
||||
const vis = [...sbBody.querySelectorAll('.sb-block')].find((b) => b.getBoundingClientRect().top >= sbBody.getBoundingClientRect().top - 2);
|
||||
return { aiScrollTop: Math.round(aiBody.scrollTop), sbScrollTop: Math.round(sbBody.scrollTop), sbVis: vis ? (vis.querySelector('.sb-head')?.textContent.trim() || '').slice(0, 28) : null };
|
||||
})()`);
|
||||
console.log('滚轮后:', JSON.stringify(st));
|
||||
process.exit(0);
|
||||
Reference in new issue
Block a user