-
Couldn't load subscription status.
- Fork 279
Selenium CDP compatibility #424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -578,6 +578,16 @@ fn Client(comptime S: type) type { | |
| return self.send(self.server.json_version_response, false); | ||
| } | ||
|
|
||
| const json_list_response = | ||
| "HTTP/1.1 200 OK\r\n" ++ | ||
| "Content-Length: 47\r\n" ++ | ||
| "Content-Type: application/json; charset=UTF-8\r\n\r\n" ++ | ||
| "[{\"id\":\"1\",\"type\":\"page\",\"url\":\"abount:blank\"}]"; | ||
|
|
||
| if (std.mem.eql(u8, url, "/json/list")) { | ||
| return self.send(json_list_response, false); | ||
| } | ||
|
|
||
| return error.NotFound; | ||
| } | ||
|
|
||
|
|
@@ -1123,12 +1133,12 @@ pub fn run( | |
|
|
||
| // Utils | ||
| // -------- | ||
|
|
||
| // | ||
| fn buildJSONVersionResponse( | ||
| allocator: Allocator, | ||
| address: net.Address, | ||
| ) ![]const u8 { | ||
| const body_format = "{{\"webSocketDebuggerUrl\": \"ws://{}/\"}}"; | ||
| const body_format = "{{\"Browser\": \"Chrome/132.0.6834.110\", \"WebKit-Version\": \"537.36 (@df453a35f099772fdb954e33551388add2ca3cde)\", \"webSocketDebuggerUrl\": \"ws://{}/\"}}"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the branch for the demo project, I followed the instructions and ran
I wonder if this version response should be optionally loaded from the command line argument / a config file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. I would be better to configure selenium with the websocket url to connect to. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Figured out that you can force which version it will download: It downloaded 132 instead of 133 with this, and it didn't complain about the version when I ran it. |
||
| const body_len = std.fmt.count(body_format, .{address}); | ||
|
|
||
| const response_format = | ||
|
|
||