Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/ferrum/client/web_socket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,14 @@ def on_message(event)
# don't push response to @messages. Worse that could happen we raise timeout error due to command didn't return
# anything or skip the background notification, but at least we don't crash the thread that crashes the main
# thread and the application.
@messages.push(data) if data

output = event.data
if SKIP_LOGGING_SCREENSHOTS && @screenshot_commands[data&.dig("id")]
@screenshot_commands.delete(data&.dig("id"))
output.sub!(/{"data":"[^"]*"}/, %("Set FERRUM_LOGGING_SCREENSHOTS=true to see screenshots in Base64"))
end

@logger&.puts(" ◀ #{Utils::ElapsedTime.elapsed_time} #{output}\n")
@messages.push(data) if data
end

def on_close(_event)
Expand Down
Loading