mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +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,
|
||||
setCacheDisabled,
|
||||
setExtraHTTPHeaders,
|
||||
setUserAgentOverride,
|
||||
deleteCookies,
|
||||
clearBrowserCookies,
|
||||
setCookie,
|
||||
@@ -40,6 +41,7 @@ pub fn processMessage(cmd: anytype) !void {
|
||||
.enable => return enable(cmd),
|
||||
.disable => return disable(cmd),
|
||||
.setCacheDisabled => return cmd.sendResult(null, .{}),
|
||||
.setUserAgentOverride => return cmd.sendResult(null, .{}),
|
||||
.setExtraHTTPHeaders => return setExtraHTTPHeaders(cmd),
|
||||
.deleteCookies => return deleteCookies(cmd),
|
||||
.clearBrowserCookies => return clearBrowserCookies(cmd),
|
||||
|
||||
@@ -31,6 +31,7 @@ pub fn processMessage(cmd: anytype) !void {
|
||||
addScriptToEvaluateOnNewDocument,
|
||||
createIsolatedWorld,
|
||||
navigate,
|
||||
stopLoading,
|
||||
}, cmd.input.action) orelse return error.UnknownMethod;
|
||||
|
||||
switch (action) {
|
||||
@@ -40,6 +41,7 @@ pub fn processMessage(cmd: anytype) !void {
|
||||
.addScriptToEvaluateOnNewDocument => return addScriptToEvaluateOnNewDocument(cmd),
|
||||
.createIsolatedWorld => return createIsolatedWorld(cmd),
|
||||
.navigate => return navigate(cmd),
|
||||
.stopLoading => return cmd.sendResult(null, .{}),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user