Class: WebkitRemote::Client::NetworkRequestInitiator
- Inherits:
-
Object
- Object
- WebkitRemote::Client::NetworkRequestInitiator
- Defined in:
- lib/webkit_remote/client/network_events.rb
Overview
Wraps information about the reason behind a network request.
Instance Attribute Summary collapse
-
#line ⇒ Number
readonly
Number of the line that references the requested resource.
-
#stack_trace ⇒ WebkitRemote::Client::StackTrace
readonly
JavaScript trace, set only for :script initiators.
-
#type ⇒ Symbol
readonly
Reason behind the request; documented values are :parser, :script and :other.
-
#url ⇒ String
readonly
URL of the document that references the requested resource.
Instance Method Summary collapse
-
#initialize(raw_initiator) ⇒ NetworkRequestInitiator
constructor
A new instance of NetworkRequestInitiator.
Constructor Details
#initialize(raw_initiator) ⇒ NetworkRequestInitiator
Returns a new instance of NetworkRequestInitiator.
511 512 513 514 515 516 517 518 519 520 521 |
# File 'lib/webkit_remote/client/network_events.rb', line 511 def initialize(raw_initiator) if raw_initiator['lineNumber'] @line = raw_initiator['lineNumber'].to_i else @line = nil end @stack_trace = WebkitRemote::Client::StackTrace.parse raw_initiator['stack'] @type = (raw_initiator['type'] || 'other').to_sym @url = raw_initiator['url'] end |
Instance Attribute Details
#line ⇒ Number (readonly)
Returns number of the line that references the requested resource.
504 505 506 |
# File 'lib/webkit_remote/client/network_events.rb', line 504 def line @line end |
#stack_trace ⇒ WebkitRemote::Client::StackTrace (readonly)
Returns JavaScript trace, set only for :script initiators.
508 509 510 |
# File 'lib/webkit_remote/client/network_events.rb', line 508 def stack_trace @stack_trace end |
#type ⇒ Symbol (readonly)
Returns reason behind the request; documented values are :parser, :script and :other.
498 499 500 |
# File 'lib/webkit_remote/client/network_events.rb', line 498 def type @type end |
#url ⇒ String (readonly)
Returns URL of the document that references the requested resource.
501 502 503 |
# File 'lib/webkit_remote/client/network_events.rb', line 501 def url @url end |