class WebkitRemote::Event::NetworkResponse

Emitted right after receiving a response to a network request.

Attributes

loader_id[R]

@return [String] used to correlate events

resource[R]

@return [WebkitRemote::Client::NetworkResource] information about the

resource fetched by this network operation
response[R]

@return [WebkitRemote::Client::NetworkResponse] information about the HTTP

response behind this event
timestamp[R]

@return [Number] the event timestamp

type[R]

@return [Symbol] the type of resource returned by this response; documented

values are :document, :font, :image, :other, :script, :stylesheet,
:websocket and :xhr

Public Class Methods

can_reach?(client) click to toggle source

@private Use Event#can_receive instead of calling this directly.

# File lib/webkit_remote/client/network_events.rb, line 210
def self.can_reach?(client)
  client.network_events
end
new(rpc_event, client) click to toggle source

@private Use Event#for instead of calling this constructor directly.

Calls superclass method WebkitRemote::Event::new
# File lib/webkit_remote/client/network_events.rb, line 193
def initialize(rpc_event, client)
  super
  @loader_id = raw_data['loaderId']
  if raw_data['response']
    @response = WebkitRemote::Client::NetworkResponse.new(
        raw_data['response'])
  end
  @type = (raw_data['type'] || 'other').downcase.to_sym
  @timestamp = raw_data['timestamp']

  @resource = client.network_resource raw_data['requestId']
  @resource.set_response @response
  @resource.set_type @type
  @resource.add_event self
end