惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
aimingoo的专栏
aimingoo的专栏
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 聂微东
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
Blog — PlanetScale
Blog — PlanetScale
大猫的无限游戏
大猫的无限游戏
Vercel News
Vercel News
D
DataBreaches.Net
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
L
LangChain Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
F
Fortinet All Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
Recent Announcements
Recent Announcements
Jina AI
Jina AI
G
Google Developers Blog
腾讯CDC
博客园_首页
博客园 - 【当耐特】

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
browser: enforce navigation checks for act interactions [...
pgondhi987 · 2026-05-13 · via Recent Commits to openclaw:main

@@ -679,6 +679,7 @@ export async function selectOptionViaPlaywright(opts: {

679679

selector?: string;

680680

values: string[];

681681

timeoutMs?: number;

682+

ssrfPolicy?: SsrFPolicy;

682683

}): Promise<void> {

683684

const resolved = requireRefOrSelector(opts.ref, opts.selector);

684685

if (!opts.values?.length) {

@@ -689,9 +690,19 @@ export async function selectOptionViaPlaywright(opts: {

689690

const locator = resolved.ref

690691

? refLocator(page, requireRef(resolved.ref))

691692

: page.locator(resolved.selector!);

693+

const previousUrl = page.url();

692694

try {

693-

await locator.selectOption(opts.values, {

694-

timeout: resolveInteractionTimeoutMs(opts.timeoutMs),

695+

await assertInteractionNavigationCompletedSafely({

696+

action: async () => {

697+

await locator.selectOption(opts.values, {

698+

timeout: resolveInteractionTimeoutMs(opts.timeoutMs),

699+

});

700+

},

701+

cdpUrl: opts.cdpUrl,

702+

page,

703+

previousUrl,

704+

ssrfPolicy: opts.ssrfPolicy,

705+

targetId: opts.targetId,

695706

});

696707

} catch (err) {

697708

throw toAIFriendlyError(err, label);

@@ -746,17 +757,29 @@ export async function typeViaPlaywright(opts: {

746757

: page.locator(resolved.selector!);

747758

const timeout = resolveInteractionTimeoutMs(opts.timeoutMs);

748759

try {

760+

const previousUrl = page.url();

749761

if (opts.slowly) {

750-

await locator.click({ timeout });

751-

await locator.type(text, { timeout, delay: 75 });

762+

await assertInteractionNavigationCompletedSafely({

763+

action: async () => {

764+

await locator.click({ timeout });

765+

await locator.type(text, { timeout, delay: 75 });

766+

if (opts.submit) {

767+

await locator.press("Enter", { timeout });

768+

}

769+

},

770+

cdpUrl: opts.cdpUrl,

771+

page,

772+

previousUrl,

773+

ssrfPolicy: opts.ssrfPolicy,

774+

targetId: opts.targetId,

775+

});

752776

} else {

753-

await locator.fill(text, { timeout });

754-

}

755-

if (opts.submit) {

756-

const previousUrl = page.url();

757777

await assertInteractionNavigationCompletedSafely({

758778

action: async () => {

759-

await locator.press("Enter", { timeout });

779+

await locator.fill(text, { timeout });

780+

if (opts.submit) {

781+

await locator.press("Enter", { timeout });

782+

}

760783

},

761784

cdpUrl: opts.cdpUrl,

762785

page,

@@ -775,6 +798,7 @@ export async function fillFormViaPlaywright(opts: {

775798

targetId?: string;

776799

fields: BrowserFormField[];

777800

timeoutMs?: number;

801+

ssrfPolicy?: SsrFPolicy;

778802

}): Promise<void> {

779803

const page = await getRestoredPageForTarget(opts);

780804

const timeout = resolveInteractionTimeoutMs(opts.timeoutMs);

@@ -796,14 +820,34 @@ export async function fillFormViaPlaywright(opts: {

796820

const checked =

797821

rawValue === true || rawValue === 1 || rawValue === "1" || rawValue === "true";

798822

try {

799-

await locator.setChecked(checked, { timeout });

823+

const previousUrl = page.url();

824+

await assertInteractionNavigationCompletedSafely({

825+

action: async () => {

826+

await locator.setChecked(checked, { timeout });

827+

},

828+

cdpUrl: opts.cdpUrl,

829+

page,

830+

previousUrl,

831+

ssrfPolicy: opts.ssrfPolicy,

832+

targetId: opts.targetId,

833+

});

800834

} catch (err) {

801835

throw toAIFriendlyError(err, ref);

802836

}

803837

continue;

804838

}

805839

try {

806-

await locator.fill(value, { timeout });

840+

const previousUrl = page.url();

841+

await assertInteractionNavigationCompletedSafely({

842+

action: async () => {

843+

await locator.fill(value, { timeout });

844+

},

845+

cdpUrl: opts.cdpUrl,

846+

page,

847+

previousUrl,

848+

ssrfPolicy: opts.ssrfPolicy,

849+

targetId: opts.targetId,

850+

});

807851

} catch (err) {

808852

throw toAIFriendlyError(err, ref);

809853

}

@@ -850,9 +894,19 @@ export async function evaluateViaPlaywright(opts: {

850894

}

851895852896

try {

897+

const previousUrl = page.url();

898+

if (opts.ssrfPolicy) {

899+

await assertPageNavigationCompletedSafely({

900+

cdpUrl: opts.cdpUrl,

901+

page,

902+

response: null,

903+

ssrfPolicy: opts.ssrfPolicy,

904+

targetId: opts.targetId,

905+

});

906+

}

907+853908

if (opts.ref) {

854909

const locator = refLocator(page, opts.ref);

855-

const previousUrl = page.url();

856910

// eslint-disable-next-line @typescript-eslint/no-implied-eval -- required for browser-context eval

857911

const elementEvaluator = new Function(

858912

"el",

@@ -892,7 +946,6 @@ export async function evaluateViaPlaywright(opts: {

892946

return result;

893947

}

894948895-

const previousUrl = page.url();

896949

// eslint-disable-next-line @typescript-eslint/no-implied-eval -- required for browser-context eval

897950

const browserEvaluator = new Function(

898951

"args",

@@ -1345,6 +1398,7 @@ async function executeSingleAction(

13451398

selector: action.selector,

13461399

values: action.values,

13471400

timeoutMs: action.timeoutMs,

1401+

ssrfPolicy,

13481402

});

13491403

break;

13501404

case "fill":

@@ -1353,6 +1407,7 @@ async function executeSingleAction(

13531407

targetId: effectiveTargetId,

13541408

fields: action.fields,

13551409

timeoutMs: action.timeoutMs,

1410+

ssrfPolicy,

13561411

});

13571412

break;

13581413

case "resize":