Class: WebkitRemote::Event::NetworkLoad

Inherits:
WebkitRemote::Event show all
Defined in:
lib/webkit_remote/client/network_events.rb

Overview

Emitted when a resource finishes loading from the network.

Instance Attribute Summary collapse

Attributes inherited from WebkitRemote::Event

#domain, #name, #raw_data

Instance Method Summary collapse

Methods inherited from WebkitRemote::Event

can_reach?, can_receive?, class_for, for, #matches?, register, register_class

Constructor Details

#initialize(rpc_event, client) ⇒ NetworkLoad

Returns a new instance of NetworkLoad.



81
82
83
84
85
86
87
# File 'lib/webkit_remote/client/network_events.rb', line 81

def initialize(rpc_event, client)
  super
  @timestamp = raw_data['timestamp']

  @resource = client.network_resource raw_data['requestId']
  @resource.add_event self
end

Instance Attribute Details

#resourceWebkitRemote::Client::NetworkResource (readonly)

Returns information about the resource fetched by this network operation.

Returns:



75
76
77
# File 'lib/webkit_remote/client/network_events.rb', line 75

def resource
  @resource
end

#timestampNumber (readonly)

Returns the event timestamp.

Returns:

  • (Number)

    the event timestamp



78
79
80
# File 'lib/webkit_remote/client/network_events.rb', line 78

def timestamp
  @timestamp
end