MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / saveCurrentEditor

Function saveCurrentEditor

e2e/utils.ts:142–155  ·  view source on GitHub ↗
(context: BrowserContext, extensionId: string, page: Page)

Source from the content-addressed store, hash-verified

140}
141
142export async function saveCurrentEditor(context: BrowserContext, extensionId: string, page: Page): Promise<void> {
143 await focusMonacoEditor(page);
144 await page.keyboard.press("ControlOrMeta+s");
145
146 const messageAppeared = await page
147 .locator(".arco-message")
148 .first()
149 .waitFor({ timeout: 10_000 })
150 .then(() => true)
151 .catch(() => false);
152 if (messageAppeared) return;
153
154 await waitForSavedScriptInList(context, extensionId);
155}
156
157/** Install a script by injecting code into the Monaco editor and saving */
158export async function installScriptByCode(context: BrowserContext, extensionId: string, code: string): Promise<void> {

Callers 3

createScriptAndGoToListFunction · 0.90
installScriptByCodeFunction · 0.85

Calls 3

focusMonacoEditorFunction · 0.85
waitForSavedScriptInListFunction · 0.85
waitForMethod · 0.65

Tested by 1

createScriptAndGoToListFunction · 0.72