mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 21:44:32 +00:00
fix(browser): honor profile attachOnly for loopback CDP (#31429)
* config(browser): allow profile attachOnly field * config(schema): accept profile attachOnly * browser(config): resolve per-profile attachOnly * browser(runtime): honor profile attachOnly checks * browser(routes): expose profile attachOnly in status * config(labels): add browser profile attachOnly label * config(help): document browser profile attachOnly * test(config): cover profile attachOnly resolution * test(browser): cover profile attachOnly runtime path * test(config): include profile attachOnly help target * changelog: note profile attachOnly override * browser(runtime): prioritize attachOnly over loopback ownership error * test(browser): cover attachOnly ws-failure ownership path
This commit is contained in:
@@ -125,6 +125,30 @@ describe("browser config", () => {
|
||||
expect(remote?.cdpIsLoopback).toBe(false);
|
||||
});
|
||||
|
||||
it("inherits attachOnly from global browser config when profile override is not set", () => {
|
||||
const resolved = resolveBrowserConfig({
|
||||
attachOnly: true,
|
||||
profiles: {
|
||||
remote: { cdpUrl: "http://127.0.0.1:9222", color: "#0066CC" },
|
||||
},
|
||||
});
|
||||
|
||||
const remote = resolveProfile(resolved, "remote");
|
||||
expect(remote?.attachOnly).toBe(true);
|
||||
});
|
||||
|
||||
it("allows profile attachOnly to override global browser attachOnly", () => {
|
||||
const resolved = resolveBrowserConfig({
|
||||
attachOnly: false,
|
||||
profiles: {
|
||||
remote: { cdpUrl: "http://127.0.0.1:9222", attachOnly: true, color: "#0066CC" },
|
||||
},
|
||||
});
|
||||
|
||||
const remote = resolveProfile(resolved, "remote");
|
||||
expect(remote?.attachOnly).toBe(true);
|
||||
});
|
||||
|
||||
it("uses base protocol for profiles with only cdpPort", () => {
|
||||
const resolved = resolveBrowserConfig({
|
||||
cdpUrl: "https://example.com:9443",
|
||||
|
||||
Reference in New Issue
Block a user