Open History to see the last commit
1import {
2 DesktopPreviewAnnotationSendEnabledInputSchema,
3 DesktopPreviewAnnotationThemeInputSchema,
4 DesktopPreviewAnnotationVoiceStateSchema,
5 DesktopPreviewPickElementInputSchema,
6 DesktopPreviewArtifactInputSchema,
7 DesktopPreviewConfigInputSchema,
8 DesktopPreviewFindInPageInputSchema,
9 DesktopPreviewNavigateInputSchema,
10 DesktopPreviewRecordingArtifactSchema,
11 DesktopPreviewRecordingSaveInputSchema,
12 DesktopPreviewRegisterWebviewInputSchema,
13 DesktopPreviewScreenshotArtifactSchema,
14 DesktopPreviewSetAudioMutedInputSchema,
15 DesktopPreviewSetShownInputSchema,
16 DesktopPreviewSetCaptureDrawnInputSchema,
17 DesktopPreviewSetColorSchemeInputSchema,
18 DesktopPreviewSetZoomFactorInputSchema,
19 BrowserImportResult,
20 BrowserImportSource,
21 DesktopPreviewClearDataInputSchema,
22 DesktopPreviewImportCookiesInputSchema,
23 DesktopPreviewCreateTabInputSchema,
24 DesktopPreviewTabInputSchema,
25 DesktopPreviewTunnelAccessResolutionInputSchema,
26 DesktopPreviewWebviewConfigSchema,
27 PreviewAnnotationSubmissionResultSchema,
28 PreviewCaptureFailure,
29 DEFAULT_BROWSER_PROFILE_ID,
30 INCOGNITO_BROWSER_PROFILE_ID,
31 PreviewForwardedShortcut,
32 MAX_KEYBINDINGS_COUNT,
33} from "@t3tools/contracts";
34import * as Effect from "effect/Effect";
35import * as Schema from "effect/Schema";
36import * as Option from "effect/Option";
37import * as NodeURL from "node:url";
38
39import * as ElectronWindow from "../../electron/ElectronWindow.ts";
40import * as BrowserImport from "../../preview/BrowserImport/BrowserImport.ts";
41import * as LoopbackTunnel from "../../preview/LoopbackTunnel.ts";
42import * as PreviewManager from "../../preview/Manager.ts";
43import { normalizeCaptureFailure } from "../../preview/captureErrors.ts";
44import * as DesktopClientSettings from "../../settings/DesktopClientSettings.ts";
45import { PREVIEW_WEBVIEW_PREFERENCES } from "../../preview/WebviewPreferences.ts";
46import * as IpcChannels from "../channels.ts";
47import * as DesktopIpc from "../DesktopIpc.ts";
48
49export const installPreviewEventForwarding = Effect.fn(
50 "desktop.ipc.preview.installEventForwarding",
51)(function* () {
52 const electronWindow = yield* ElectronWindow.ElectronWindow;
53 const manager = yield* PreviewManager.PreviewManager;
54 yield* manager.subscribeStateChanges((tabId, state) =>
55 electronWindow.sendAll(IpcChannels.PREVIEW_STATE_CHANGE_CHANNEL, tabId, state),
56 );
57 yield* manager.subscribeRecordingInputs((event) =>
58 electronWindow.sendAll(IpcChannels.PREVIEW_RECORDING_INPUT_CHANNEL, event),
59 );
60 yield* manager.subscribePointerEvents((event) =>
61 electronWindow.sendAll(IpcChannels.PREVIEW_POINTER_EVENT_CHANNEL, event),
62 );
63 yield* manager.subscribeOpenLinks((event) =>
64 electronWindow.sendAll(IpcChannels.PREVIEW_OPEN_LINK_CHANNEL, event),
65 );
66 yield* manager.subscribeFindResults((event) =>
67 electronWindow.sendAll(IpcChannels.PREVIEW_FIND_RESULT_CHANNEL, event),
68 );
69});
70
71const setForwardedShortcuts = DesktopIpc.makeIpcMethod({
72 channel: IpcChannels.PREVIEW_SET_FORWARDED_SHORTCUTS_CHANNEL,
73 payload: Schema.Array(PreviewForwardedShortcut).check(Schema.isMaxLength(MAX_KEYBINDINGS_COUNT)),
74 result: Schema.Void,
75 handler: Effect.fn("desktop.ipc.preview.setForwardedShortcuts")(function* (shortcuts) {
76 const manager = yield* PreviewManager.PreviewManager;
77 yield* manager.setForwardedShortcuts(shortcuts);
78 }),
79});
80
81const createTab = DesktopIpc.makeIpcMethod({
82 channel: IpcChannels.PREVIEW_CREATE_TAB_CHANNEL,
83 payload: DesktopPreviewCreateTabInputSchema,
84 result: Schema.Void,
85 handler: Effect.fn("desktop.ipc.preview.createTab")(function* ({
86 tabId,
87 zoomFactor,
88 colorScheme,
89 serverTab,
90 }) {
91 const manager = yield* PreviewManager.PreviewManager;
92 yield* manager.createTab(tabId, { zoomFactor, colorScheme, serverTab });
93 }),
94});
95
96const closeTab = DesktopIpc.makeIpcMethod({
97 channel: IpcChannels.PREVIEW_CLOSE_TAB_CHANNEL,
98 payload: DesktopPreviewTabInputSchema,
99 result: Schema.Void,
100 handler: Effect.fn("desktop.ipc.preview.closeTab")(function* ({ tabId }) {
101 const manager = yield* PreviewManager.PreviewManager;
102 yield* manager.closeTab(tabId);
103 }),
104});
105
106const registerWebview = DesktopIpc.makeIpcMethod({
107 channel: IpcChannels.PREVIEW_REGISTER_WEBVIEW_CHANNEL,
108 payload: DesktopPreviewRegisterWebviewInputSchema,
109 result: Schema.Void,
110 handler: Effect.fn("desktop.ipc.preview.registerWebview")(function* ({ tabId, webContentsId }) {
111 const manager = yield* PreviewManager.PreviewManager;
112 yield* manager.registerWebview(tabId, webContentsId);
113 }),
114});
115
116const navigate = DesktopIpc.makeIpcMethod({
117 channel: IpcChannels.PREVIEW_NAVIGATE_CHANNEL,
118 payload: DesktopPreviewNavigateInputSchema,
119 result: Schema.Void,
120 handler: Effect.fn("desktop.ipc.preview.navigate")(function* ({ tabId, url }) {
121 const manager = yield* PreviewManager.PreviewManager;
122 yield* manager.navigate(tabId, url);
123 }),
124});
125
126const findInPage = DesktopIpc.makeIpcMethod({
127 channel: IpcChannels.PREVIEW_FIND_IN_PAGE_CHANNEL,
128 payload: DesktopPreviewFindInPageInputSchema,
129 result: Schema.Void,
130 handler: Effect.fn("desktop.ipc.preview.findInPage")(function* ({
131 tabId,
132 text,
133 forward,
134 newSession,
135 }) {
136 const manager = yield* PreviewManager.PreviewManager;
137 yield* manager.findInPage(tabId, text, { forward, newSession });
138 }),
139});
140
141const tabMethod = (
142 channel: string,
143 name: string,
144 invoke: (
145 manager: PreviewManager.PreviewManager["Service"],
146 tabId: string,
147 ) => Effect.Effect<void, PreviewManager.PreviewManagerError>,
148) =>
149 DesktopIpc.makeIpcMethod({
150 channel,
151 payload: DesktopPreviewTabInputSchema,
152 result: Schema.Void,
153 handler: Effect.fn(name)(function* ({ tabId }) {
154 const manager = yield* PreviewManager.PreviewManager;
155 yield* invoke(manager, tabId);
156 }),
157 });
158
159const goBack = tabMethod(
160 IpcChannels.PREVIEW_GO_BACK_CHANNEL,
161 "desktop.ipc.preview.goBack",
162 (manager, tabId) => manager.goBack(tabId),
163);
164const goForward = tabMethod(
165 IpcChannels.PREVIEW_GO_FORWARD_CHANNEL,
166 "desktop.ipc.preview.goForward",
167 (manager, tabId) => manager.goForward(tabId),
168);
169const refresh = tabMethod(
170 IpcChannels.PREVIEW_REFRESH_CHANNEL,
171 "desktop.ipc.preview.refresh",
172 (manager, tabId) => manager.refresh(tabId),
173);
174const stopLoading = tabMethod(
175 IpcChannels.PREVIEW_STOP_LOADING_CHANNEL,
176 "desktop.ipc.preview.stopLoading",
177 (manager, tabId) => manager.stopLoading(tabId),
178);
179const zoomIn = tabMethod(
180 IpcChannels.PREVIEW_ZOOM_IN_CHANNEL,
181 "desktop.ipc.preview.zoomIn",
182 (manager, tabId) => manager.zoomIn(tabId),
183);
184const zoomOut = tabMethod(
185 IpcChannels.PREVIEW_ZOOM_OUT_CHANNEL,
186 "desktop.ipc.preview.zoomOut",
187 (manager, tabId) => manager.zoomOut(tabId),
188);
189const resetZoom = tabMethod(
190 IpcChannels.PREVIEW_RESET_ZOOM_CHANNEL,
191 "desktop.ipc.preview.resetZoom",
192 (manager, tabId) => manager.resetZoom(tabId),
193);
194const hardReload = tabMethod(
195 IpcChannels.PREVIEW_HARD_RELOAD_CHANNEL,
196 "desktop.ipc.preview.hardReload",
197 (manager, tabId) => manager.hardReload(tabId),
198);
199const stopFindInPage = tabMethod(
200 IpcChannels.PREVIEW_STOP_FIND_IN_PAGE_CHANNEL,
201 "desktop.ipc.preview.stopFindInPage",
202 (manager, tabId) => manager.stopFindInPage(tabId),
203);
204const setZoomFactor = DesktopIpc.makeIpcMethod({
205 channel: IpcChannels.PREVIEW_SET_ZOOM_FACTOR_CHANNEL,
206 payload: DesktopPreviewSetZoomFactorInputSchema,
207 result: Schema.Void,
208 handler: Effect.fn("desktop.ipc.preview.setZoomFactor")(function* ({ tabId, zoomFactor }) {
209 const manager = yield* PreviewManager.PreviewManager;
210 yield* manager.setZoomFactor(tabId, zoomFactor);
211 }),
212});
213const setColorScheme = DesktopIpc.makeIpcMethod({
214 channel: IpcChannels.PREVIEW_SET_COLOR_SCHEME_CHANNEL,
215 payload: DesktopPreviewSetColorSchemeInputSchema,
216 result: Schema.Void,
217 handler: Effect.fn("desktop.ipc.preview.setColorScheme")(function* ({ tabId, colorScheme }) {
218 const manager = yield* PreviewManager.PreviewManager;
219 yield* manager.setColorScheme(tabId, colorScheme);
220 }),
221});
222const setAudioMuted = DesktopIpc.makeIpcMethod({
223 channel: IpcChannels.PREVIEW_SET_AUDIO_MUTED_CHANNEL,
224 payload: DesktopPreviewSetAudioMutedInputSchema,
225 result: Schema.Void,
226 handler: Effect.fn("desktop.ipc.preview.setAudioMuted")(function* ({ tabId, audioMuted }) {
227 const manager = yield* PreviewManager.PreviewManager;
228 yield* manager.setAudioMuted(tabId, audioMuted);
229 }),
230});
231const setShown = DesktopIpc.makeIpcMethod({
232 channel: IpcChannels.PREVIEW_SET_SHOWN_CHANNEL,
233 payload: DesktopPreviewSetShownInputSchema,
234 result: Schema.Void,
235 handler: Effect.fn("desktop.ipc.preview.setShown")(function* ({ tabId, shown }) {
236 const manager = yield* PreviewManager.PreviewManager;
237 yield* manager.setShown(tabId, shown);
238 }),
239});
240const setCaptureDrawn = DesktopIpc.makeIpcMethod({
241 channel: IpcChannels.PREVIEW_SET_CAPTURE_DRAWN_CHANNEL,
242 payload: DesktopPreviewSetCaptureDrawnInputSchema,
243 result: Schema.Void,
244 handler: Effect.fn("desktop.ipc.preview.setCaptureDrawn")(function* ({ tabId, drawn }) {
245 const manager = yield* PreviewManager.PreviewManager;
246 yield* manager.setCaptureDrawn(tabId, drawn);
247 }),
248});
249const openDevTools = tabMethod(
250 IpcChannels.PREVIEW_OPEN_DEVTOOLS_CHANNEL,
251 "desktop.ipc.preview.openDevTools",
252 (manager, tabId) => manager.openDevTools(tabId),
253);
254const cancelPickElement = tabMethod(
255 IpcChannels.PREVIEW_CANCEL_PICK_ELEMENT_CHANNEL,
256 "desktop.ipc.preview.cancelPickElement",
257 (manager, tabId) => manager.cancelPickElement(tabId),
258);
259export const startRecording = DesktopIpc.makeIpcMethod({
260 channel: IpcChannels.PREVIEW_RECORDING_START_CHANNEL,
261 payload: DesktopPreviewTabInputSchema,
262 // Void encodes any value as undefined, so the tagged failure must be tried first.
263 result: Schema.Union([PreviewCaptureFailure, Schema.Void]),
264 handler: Effect.fn("desktop.ipc.preview.startRecording")(function* ({ tabId }) {
265 const manager = yield* PreviewManager.PreviewManager;
266 const store = yield* DesktopClientSettings.DesktopClientSettings;
267 const settings = yield* store.get;
268 const options = Option.map(settings, (value) => ({
269 showKeyPresses: value.browserRecordingShowKeyPresses,
270 showMousePresses: value.browserRecordingShowMousePresses,
271 }));
272 return yield* manager
273 .startRecording(tabId, Option.getOrUndefined(options))
274 .pipe(
275 Effect.catch((error) => Effect.succeed(normalizeCaptureFailure(error, "recording-start"))),
276 );
277 }),
278});
279const stopRecording = tabMethod(
280 IpcChannels.PREVIEW_RECORDING_STOP_CHANNEL,
281 "desktop.ipc.preview.stopRecording",
282 (manager, tabId) => manager.stopRecording(tabId),
283);
284const openPictureInPicture = tabMethod(
285 IpcChannels.PREVIEW_PICTURE_IN_PICTURE_OPEN_CHANNEL,
286 "desktop.ipc.preview.openPictureInPicture",
287 (manager, tabId) => manager.openPictureInPicture(tabId),
288);
289const closePictureInPicture = tabMethod(
290 IpcChannels.PREVIEW_PICTURE_IN_PICTURE_CLOSE_CHANNEL,
291 "desktop.ipc.preview.closePictureInPicture",
292 (manager, tabId) => manager.closePictureInPicture(tabId),
293);
294
295const clearCookies = DesktopIpc.makeIpcMethod({
296 channel: IpcChannels.PREVIEW_CLEAR_COOKIES_CHANNEL,
297 payload: DesktopPreviewClearDataInputSchema,
298 result: Schema.Void,
299 handler: Effect.fn("desktop.ipc.preview.clearCookies")(function* ({ environmentId, profileId }) {
300 const manager = yield* PreviewManager.PreviewManager;
301 yield* manager.clearCookies(yield* resolveClearPartitions(manager, environmentId, profileId));
302 }),
303});
304
305const clearCache = DesktopIpc.makeIpcMethod({
306 channel: IpcChannels.PREVIEW_CLEAR_CACHE_CHANNEL,
307 payload: DesktopPreviewClearDataInputSchema,
308 result: Schema.Void,
309 handler: Effect.fn("desktop.ipc.preview.clearCache")(function* ({ environmentId, profileId }) {
310 const manager = yield* PreviewManager.PreviewManager;
311 yield* manager.clearCache(yield* resolveClearPartitions(manager, environmentId, profileId));
312 }),
313});
314
315/** Keep the default profile's bare environment id so existing logins retain their partition. */
316export function resolvePartitionScope(
317 environmentId: string,
318 profileId: string | undefined,
319): {
320 readonly scope: string;
321 readonly persistent: boolean;
322 readonly namespace?: "profile";
323} {
324 if (profileId === undefined || profileId === DEFAULT_BROWSER_PROFILE_ID) {
325 return { scope: environmentId, persistent: true };
326 }
327 // JSON framing preserves lone UTF-16 surrogates; URI encoding throws and replacement would collide.
328 return {
329 scope: JSON.stringify([environmentId, profileId]),
330 persistent: profileId !== INCOGNITO_BROWSER_PROFILE_ID,
331 namespace: "profile" as const,
332 };
333}
334
335/** Omitting a profile clears every partition; a named profile clears only its own partition. */
336const resolveClearPartitions = Effect.fn("desktop.ipc.preview.resolveClearPartitions")(function* (
337 manager: PreviewManager.PreviewManager["Service"],
338 environmentId: string,
339 profileId: string | undefined,
340) {
341 if (profileId === undefined) return undefined;
342 const { scope, persistent, namespace } = resolvePartitionScope(environmentId, profileId);
343 // getBrowserSession registers the partition; deriving its name alone leaves unopened profiles uncleared.
344 yield* manager.getBrowserSession(scope, persistent, namespace);
345 return [yield* manager.getBrowserPartition(scope, persistent, namespace)];
346});
347
348const getPreviewConfig = DesktopIpc.makeIpcMethod({
349 channel: IpcChannels.PREVIEW_GET_CONFIG_CHANNEL,
350 payload: DesktopPreviewConfigInputSchema,
351 result: DesktopPreviewWebviewConfigSchema,
352 handler: Effect.fn("desktop.ipc.preview.getConfig")(function* ({
353 environmentId,
354 profileId,
355 tunnelLoopback,
356 }) {
357 const manager = yield* PreviewManager.PreviewManager;
358 const tunnel = yield* LoopbackTunnel.LoopbackTunnel;
359 const { scope, persistent, namespace } = resolvePartitionScope(environmentId, profileId);
360 // Session creation installs UA and permission handlers before a guest can attach.
361 const session = yield* manager.getBrowserSession(scope, persistent, namespace);
362 // Routed before the renderer learns the partition, so no guest loads loopback directly.
363 yield* tunnel.route({ environmentId, session, tunnelled: tunnelLoopback === true });
364 return {
365 partition: yield* manager.getBrowserPartition(scope, persistent, namespace),
366 webPreferences: PREVIEW_WEBVIEW_PREFERENCES,
367 preloadUrl: NodeURL.pathToFileURL(`${__dirname}/preview-pick-preload.cjs`).href,
368 };
369 }),
370});
371
372const resolveTunnelAccess = DesktopIpc.makeIpcMethod({
373 channel: IpcChannels.PREVIEW_TUNNEL_ACCESS_RESOLVE_CHANNEL,
374 payload: DesktopPreviewTunnelAccessResolutionInputSchema,
375 result: Schema.Void,
376 handler: Effect.fn("desktop.ipc.preview.resolveTunnelAccess")(function* (input) {
377 const tunnel = yield* LoopbackTunnel.LoopbackTunnel;
378 yield* tunnel.resolveAccess(input);
379 }),
380});
381
382export const listBrowserImportSources = DesktopIpc.makeIpcMethod({
383 channel: IpcChannels.PREVIEW_IMPORT_SOURCES_CHANNEL,
384 payload: Schema.Void,
385 result: Schema.Array(BrowserImportSource),
386 handler: Effect.fn("desktop.ipc.preview.listBrowserImportSources")(function* () {
387 const browserImport = yield* BrowserImport.BrowserImport;
388 return yield* browserImport.listSources;
389 }),
390});
391
392export const importBrowserCookies = DesktopIpc.makeIpcMethod({
393 channel: IpcChannels.PREVIEW_IMPORT_COOKIES_CHANNEL,
394 payload: DesktopPreviewImportCookiesInputSchema,
395 result: BrowserImportResult,
396 handler: Effect.fn("desktop.ipc.preview.importBrowserCookies")(function* ({
397 environmentId,
398 ...importInput
399 }) {
400 const browserImport = yield* BrowserImport.BrowserImport;
401 const { scope, persistent, namespace } = resolvePartitionScope(
402 environmentId,
403 importInput.targetProfileId,
404 );
405 return yield* browserImport.importCookies({
406 input: importInput,
407 scope,
408 persistent,
409 ...(namespace === undefined ? {} : { namespace }),
410 });
411 }),
412});
413
414const setAnnotationTheme = DesktopIpc.makeIpcMethod({
415 channel: IpcChannels.PREVIEW_SET_ANNOTATION_THEME_CHANNEL,
416 payload: DesktopPreviewAnnotationThemeInputSchema,
417 result: Schema.Void,
418 handler: Effect.fn("desktop.ipc.preview.setAnnotationTheme")(function* ({ theme }) {
419 const manager = yield* PreviewManager.PreviewManager;
420 yield* manager.setAnnotationTheme(theme);
421 }),
422});
423
424const pickElement = DesktopIpc.makeIpcMethod({
425 channel: IpcChannels.PREVIEW_PICK_ELEMENT_CHANNEL,
426 payload: DesktopPreviewPickElementInputSchema,
427 result: Schema.NullOr(PreviewAnnotationSubmissionResultSchema),
428 handler: Effect.fn("desktop.ipc.preview.pickElement")(function* ({ tabId, voice }) {
429 const manager = yield* PreviewManager.PreviewManager;
430 return yield* manager.pickElement(tabId, voice);
431 }),
432});
433
434const updateAnnotationVoice = DesktopIpc.makeIpcMethod({
435 channel: IpcChannels.PREVIEW_ANNOTATION_VOICE_STATE_CHANNEL,
436 payload: DesktopPreviewAnnotationVoiceStateSchema,
437 result: Schema.Void,
438 handler: Effect.fn("desktop.ipc.preview.updateAnnotationVoice")(function* (state) {
439 const manager = yield* PreviewManager.PreviewManager;
440 yield* manager.updateAnnotationVoice(state);
441 }),
442});
443
444const setAnnotationSendEnabled = DesktopIpc.makeIpcMethod({
445 channel: IpcChannels.PREVIEW_SET_ANNOTATION_SEND_ENABLED_CHANNEL,
446 payload: DesktopPreviewAnnotationSendEnabledInputSchema,
447 result: Schema.Void,
448 handler: Effect.fn("desktop.ipc.preview.setAnnotationSendEnabled")(function* ({
449 tabId,
450 enabled,
451 }) {
452 const manager = yield* PreviewManager.PreviewManager;
453 yield* manager.setAnnotationSendEnabled(tabId, enabled);
454 }),
455});
456
457export const captureScreenshot = DesktopIpc.makeIpcMethod({
458 channel: IpcChannels.PREVIEW_CAPTURE_SCREENSHOT_CHANNEL,
459 payload: DesktopPreviewTabInputSchema,
460 result: Schema.Union([DesktopPreviewScreenshotArtifactSchema, PreviewCaptureFailure]),
461 handler: Effect.fn("desktop.ipc.preview.captureScreenshot")(function* ({ tabId }) {
462 const manager = yield* PreviewManager.PreviewManager;
463 return yield* manager
464 .captureScreenshot(tabId)
465 .pipe(Effect.catch((error) => Effect.succeed(normalizeCaptureFailure(error, "screenshot"))));
466 }),
467});
468
469const revealArtifact = DesktopIpc.makeIpcMethod({
470 channel: IpcChannels.PREVIEW_REVEAL_ARTIFACT_CHANNEL,
471 payload: DesktopPreviewArtifactInputSchema,
472 result: Schema.Void,
473 handler: Effect.fn("desktop.ipc.preview.revealArtifact")(function* ({ path }) {
474 const manager = yield* PreviewManager.PreviewManager;
475 yield* manager.revealArtifact(path);
476 }),
477});
478
479const copyArtifactToClipboard = DesktopIpc.makeIpcMethod({
480 channel: IpcChannels.PREVIEW_COPY_ARTIFACT_CHANNEL,
481 payload: DesktopPreviewArtifactInputSchema,
482 result: Schema.Void,
483 handler: Effect.fn("desktop.ipc.preview.copyArtifactToClipboard")(function* ({ path }) {
484 const manager = yield* PreviewManager.PreviewManager;
485 yield* manager.copyArtifactToClipboard(path);
486 }),
487});
488
489const saveRecording = DesktopIpc.makeIpcMethod({
490 channel: IpcChannels.PREVIEW_RECORDING_SAVE_CHANNEL,
491 payload: DesktopPreviewRecordingSaveInputSchema,
492 result: DesktopPreviewRecordingArtifactSchema,
493 handler: Effect.fn("desktop.ipc.preview.saveRecording")(function* ({ tabId, mimeType, data }) {
494 const manager = yield* PreviewManager.PreviewManager;
495 return yield* manager.saveRecording(tabId, mimeType, data);
496 }),
497});
498
499export const methods = [
500 setForwardedShortcuts,
501 updateAnnotationVoice,
502 createTab,
503 closeTab,
504 registerWebview,
505 navigate,
506 goBack,
507 goForward,
508 refresh,
509 stopLoading,
510 zoomIn,
511 zoomOut,
512 resetZoom,
513 hardReload,
514 findInPage,
515 stopFindInPage,
516 setColorScheme,
517 setZoomFactor,
518 setAudioMuted,
519 setShown,
520 setCaptureDrawn,
521 openDevTools,
522 clearCookies,
523 clearCache,
524 getPreviewConfig,
525 resolveTunnelAccess,
526 setAnnotationTheme,
527 setAnnotationSendEnabled,
528 pickElement,
529 cancelPickElement,
530 captureScreenshot,
531 revealArtifact,
532 copyArtifactToClipboard,
533 openPictureInPicture,
534 closePictureInPicture,
535 startRecording,
536 stopRecording,
537 saveRecording,
538] as const;