| 140 | } |
| 141 | |
| 142 | export 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 */ |
| 158 | export async function installScriptByCode(context: BrowserContext, extensionId: string, code: string): Promise<void> { |