aboutsummaryrefslogtreecommitdiff
path: root/src/registry.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/registry.ts')
-rw-r--r--src/registry.ts41
1 files changed, 22 insertions, 19 deletions
diff --git a/src/registry.ts b/src/registry.ts
index 5f9d7da..d9b7cea 100644
--- a/src/registry.ts
+++ b/src/registry.ts
@@ -16,31 +16,34 @@ import { dragAndDropTool } from "./domains/drag";
import { httpGetTool, getNetworkLogTool } from "./domains/network";
import { executeJsTool, runScriptTool } from "./domains/js";
+// Mutation tools that modify page / browser state are marked `serialized: true`
+// so they run through a shared async mutex. Observation / read-only tools are
+// left unmarked and can execute in parallel.
const TOOLS: ReadonlyArray<AnyBrowserToolDefinition> = [
- clickTool,
- typeTool,
- pressKeyTool,
- dispatchKeyTool,
- scrollTool,
+ { ...clickTool, serialized: true },
+ { ...typeTool, serialized: true },
+ { ...pressKeyTool, serialized: true },
+ { ...dispatchKeyTool, serialized: true },
+ { ...scrollTool, serialized: true },
pageInfoTool,
waitTool,
- waitForLoadTool,
- handleDialogTool,
+ { ...waitForLoadTool, serialized: true },
+ { ...handleDialogTool, serialized: true },
screenshotTool,
- navigateTool,
- openUrlsTool,
- goBackTool,
- goForwardTool,
- reloadTool,
+ { ...navigateTool, serialized: true },
+ { ...openUrlsTool, serialized: true },
+ { ...goBackTool, serialized: true },
+ { ...goForwardTool, serialized: true },
+ { ...reloadTool, serialized: true },
listTabsTool,
currentTabTool,
- switchTabTool,
- newTabTool,
- uploadFileTool,
- downloadTool,
- printToPdfTool,
- viewportResizeTool,
- dragAndDropTool,
+ { ...switchTabTool, serialized: true },
+ { ...newTabTool, serialized: true },
+ { ...uploadFileTool, serialized: true },
+ { ...downloadTool, serialized: true },
+ { ...printToPdfTool, serialized: true },
+ { ...viewportResizeTool, serialized: true },
+ { ...dragAndDropTool, serialized: true },
httpGetTool,
getNetworkLogTool,
executeJsTool,