Skip to content

Commit 1628299

Browse files
committed
fix: wait_for_idle has issue with window.URL.createObjectURL
1 parent d7e221b commit 1628299

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/ferrum/network/exchange.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def blocked?
8383
# @return [Boolean]
8484
#
8585
def finished?
86-
blocked? || response&.loaded? || !error.nil? || ping?
86+
blocked? || response&.loaded? || !error.nil? || ping? || !!url&.start_with?("blob:")
8787
end
8888

8989
#

spec/network/exchange_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@
136136
exchange.request = Ferrum::Network::Request.new({ "type" => "Ping" })
137137
expect(exchange.finished?).to be true
138138
end
139+
140+
it "returns true for blob requests" do
141+
exchange = Ferrum::Network::Exchange.new(page, "1")
142+
expect(exchange.finished?).to be false
143+
144+
exchange.request = Ferrum::Network::Request.new({ "type" => "Document", "request" => { "url" => "blob:null/75787aaf-a81f-4237-98d7-0d51fe6cfcba" } })
145+
expect(exchange.finished?).to be true
146+
end
139147
end
140148

141149
describe "#redirect?" do

0 commit comments

Comments
 (0)