def call(method, params = nil)
    request_id = @next_id
    @next_id += 1
    request = {
      jsonrpc: '2.0',
      id: request_id,
      method: method,
    }
    request[:params] = params if params
    request_json = JSON.dump request
    @web_socket.send_frame request_json

    loop do
      result = receive_message request_id
      return result if result
    end
  end
def call(method, params = nil)
    request_id = @next_id
    @next_id += 1
    request = {
      jsonrpc: '2.0',
      id: request_id,
      method: method,
    }
    request[:params] = params if params
    request_json = JSON.dump request
    @web_socket.send_frame request_json

    loop do
      result = receive_message request_id
      return result if result
    end
  end
Connects to the remote debugging server in a Webkit tab.

 @param [Hash] opts info on the tab to connect to
 @option opts [WebkitRemote::Tab] tab reference to the tab whose debugger
     server this RPC client connects to
 Remote debugging RPC call.

 See the following URL for implemented calls.
     https://developers.google.com/chrome-developer-tools/docs/protocol/1.1/index

 @param [String] method name of the RPC method to be invoked
 @param [Hash<String, Object>, nil] params parameters for the RPC method to
     be invoked
 @return [Hash<String, Object>] the return value of the RPC method