Skip to content

Commit e154f86

Browse files
committed
Fix debug_url for latest version of chrome
it appears that devtoolsFrontendUrl returns a fully qualified URL in the latest version of Chrome, so it should be returned as-is without prepending anything to it.
1 parent 796a2f3 commit e154f86

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/capybara/cuprite/driver.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def debug_url
280280
devtools_frontend_path = response[0]&.[]("devtoolsFrontendUrl")
281281
raise "Could not generate debug url for remote debugging session" unless devtools_frontend_path
282282

283-
build_remote_debug_url(path: devtools_frontend_path)
283+
devtools_frontend_path
284284
end
285285

286286
def debug(binding = nil)

spec/lib/driver_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@
3636
uri = instance_double(URI)
3737

3838
allow(driver).to receive(:URI).with("http://127.0.0.1:12345/json").and_return(uri)
39-
allow(Net::HTTP).to receive(:get).with(uri).and_return(%([{"devtoolsFrontendUrl":"/works"}]))
39+
allow(Net::HTTP).to receive(:get).with(uri).and_return(
40+
%([{"devtoolsFrontendUrl":"https://chrome-devtools-frontend.appspot.com/serve_rev"}])
41+
)
4042

41-
expect(driver.debug_url).to eq("http://127.0.0.1:12345/works")
43+
expect(driver.debug_url).to eq("https://chrome-devtools-frontend.appspot.com/serve_rev")
4244
end
4345
end
4446

0 commit comments

Comments
 (0)