module WebkitRemote::Client::Console

API for the Console domain.

Attributes

console_events[R]

@return [Boolean] true if the debugger generates Console.* events

console_messages[R]

@return [Array<WebkitRemote::Client::ConsoleMessage>]

Public Instance Methods

clear_console() click to toggle source

Removes all the messages in the console.

@return [WebkitRemote::Client] self

# File lib/webkit_remote/client/console.rb, line 23
def clear_console
  @rpc.call 'Runtime.discardConsoleEntries'
  @console_messages.each(&:release_params)
  @console_messages.clear
  self
end
console_add_message(message) click to toggle source

@private Called by the ConsoleMessage event constructor

# File lib/webkit_remote/client/console.rb, line 37
def console_add_message(message)
  @console_messages << message
end
console_events=(new_console_events) click to toggle source

Enables or disables the generation of events in the Console domain.

@param [Boolean] new_console_events if true, the browser debugger will

generate Console.* events
# File lib/webkit_remote/client/console.rb, line 11
def console_events=(new_console_events)
  new_console_events = !!new_console_events
  if new_console_events != console_events
    @rpc.call(new_console_events ? 'Console.enable' : 'Console.disable')
    @console_events = new_console_events
  end
  new_console_events
end
initialize_console() click to toggle source

@private Called by the Client constructor to set up Console data.

# File lib/webkit_remote/client/console.rb, line 42
def initialize_console
  @console_events = false
  @console_messages = []
end