mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
Noop CDP methods that go-rod requires
go-rod appears to stop processing when it receives an error, such as UnknownMethod. Added placeholder handlers for Network.setUserAgentOverride and Page.stopLoading. Setting a custom user agent is something still being discussed, so no-oping it seems reasonable. And, due to the currently synchronous nature of the initial page load, no-oping stopLoading also seems reasonable. https://github.com/lightpanda-io/browser/issues/867
This commit is contained in:
@@ -29,6 +29,7 @@ pub fn processMessage(cmd: anytype) !void {
|
|||||||
disable,
|
disable,
|
||||||
setCacheDisabled,
|
setCacheDisabled,
|
||||||
setExtraHTTPHeaders,
|
setExtraHTTPHeaders,
|
||||||
|
setUserAgentOverride,
|
||||||
deleteCookies,
|
deleteCookies,
|
||||||
clearBrowserCookies,
|
clearBrowserCookies,
|
||||||
setCookie,
|
setCookie,
|
||||||
@@ -40,6 +41,7 @@ pub fn processMessage(cmd: anytype) !void {
|
|||||||
.enable => return enable(cmd),
|
.enable => return enable(cmd),
|
||||||
.disable => return disable(cmd),
|
.disable => return disable(cmd),
|
||||||
.setCacheDisabled => return cmd.sendResult(null, .{}),
|
.setCacheDisabled => return cmd.sendResult(null, .{}),
|
||||||
|
.setUserAgentOverride => return cmd.sendResult(null, .{}),
|
||||||
.setExtraHTTPHeaders => return setExtraHTTPHeaders(cmd),
|
.setExtraHTTPHeaders => return setExtraHTTPHeaders(cmd),
|
||||||
.deleteCookies => return deleteCookies(cmd),
|
.deleteCookies => return deleteCookies(cmd),
|
||||||
.clearBrowserCookies => return clearBrowserCookies(cmd),
|
.clearBrowserCookies => return clearBrowserCookies(cmd),
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ pub fn processMessage(cmd: anytype) !void {
|
|||||||
addScriptToEvaluateOnNewDocument,
|
addScriptToEvaluateOnNewDocument,
|
||||||
createIsolatedWorld,
|
createIsolatedWorld,
|
||||||
navigate,
|
navigate,
|
||||||
|
stopLoading,
|
||||||
}, cmd.input.action) orelse return error.UnknownMethod;
|
}, cmd.input.action) orelse return error.UnknownMethod;
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
@@ -40,6 +41,7 @@ pub fn processMessage(cmd: anytype) !void {
|
|||||||
.addScriptToEvaluateOnNewDocument => return addScriptToEvaluateOnNewDocument(cmd),
|
.addScriptToEvaluateOnNewDocument => return addScriptToEvaluateOnNewDocument(cmd),
|
||||||
.createIsolatedWorld => return createIsolatedWorld(cmd),
|
.createIsolatedWorld => return createIsolatedWorld(cmd),
|
||||||
.navigate => return navigate(cmd),
|
.navigate => return navigate(cmd),
|
||||||
|
.stopLoading => return cmd.sendResult(null, .{}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user