class WebkitRemote::Client::NetworkRequestInitiator

Wraps information about the reason behind a network request.

Attributes

line[R]

@return [Number] number of the line that references the requested resource

stack_trace[R]

@return [WebkitRemote::Client::StackTrace] JavaScript trace, set only for

:script initiators
type[R]

@return [Symbol] reason behind the request; documented values are :parser,

:script and :other
url[R]

@return [String] URL of the document that references the requested resource

Public Class Methods

new(raw_initiator) click to toggle source

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

# 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