diff --git a/scripts/extension-shots/site-shots.ts b/scripts/extension-shots/site-shots.ts index 841f9fa1..4aa3b5c9 100644 --- a/scripts/extension-shots/site-shots.ts +++ b/scripts/extension-shots/site-shots.ts @@ -15,7 +15,7 @@ import { execFileSync } from "node:child_process"; import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import { join, resolve } from "node:path"; -import { Cdp, Workbench, launchVsCode, sleep, type Rect, type Webview } from "./vscode"; +import { Cdp, Workbench, jsLiteral, launchVsCode, sleep, type Rect, type Webview } from "./vscode"; import { REST, changesView, editorLine, onlyPane, openFile, openGraph, reset, rowBySubject, setBlame, showSidebar } from "./ui"; const REPO = resolve(__dirname, "../.."); @@ -48,7 +48,7 @@ async function typeMessage(wb: Workbench, ch: Webview, msg: string): Promise - m.eval(`(() => { const b = D.querySelector(${JSON.stringify(sel)}); if (!b) return false; b.dispatchEvent(new MouseEvent('mousedown', { bubbles: true, cancelable: true, button: 0 })); return true; })()`); + m.eval(`(() => { const b = D.querySelector(${jsLiteral(sel)}); if (!b) return false; b.dispatchEvent(new MouseEvent('mousedown', { bubbles: true, cancelable: true, button: 0 })); return true; })()`); if (!(await press('.jb-gutter-a .jb-change-actions[data-category="conflict"] .jb-btn-accept'))) throw new Error("no conflict to half take"); await sleep(800); if (!(await press('.jb-gutter-b .jb-change-actions[data-category="theirs-only"] .jb-btn-accept')))