mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-10 18:13:02 +00:00
fix(browser): reject excessive viewport resizes
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { ACT_MAX_VIEWPORT_DIMENSION } from "../browser/act-policy.js";
|
||||
import { callBrowserResize, type BrowserParentOpts } from "./browser-cli-shared.js";
|
||||
import { danger, defaultRuntime } from "./core-api.js";
|
||||
|
||||
@@ -16,6 +17,13 @@ export async function runBrowserResizeWithOutput(params: {
|
||||
defaultRuntime.exit(1);
|
||||
return;
|
||||
}
|
||||
if (width > ACT_MAX_VIEWPORT_DIMENSION || height > ACT_MAX_VIEWPORT_DIMENSION) {
|
||||
defaultRuntime.error(
|
||||
danger(`width and height must not exceed ${ACT_MAX_VIEWPORT_DIMENSION}`),
|
||||
);
|
||||
defaultRuntime.exit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
const result = await callBrowserResize(
|
||||
params.parent,
|
||||
|
||||
Reference in New Issue
Block a user