Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ryotarai/chromium_remote_debugging


https://github.com/ryotarai/chromium_remote_debugging

Last synced: 9 days ago
JSON representation

Awesome Lists containing this project

README

        

# ChromiumRemoteDebugging

**This gem is under development and doesn't work yet.**

A library for ruby to manipulate [Chromium Remote Debugging API](https://developers.google.com/chrome-developer-tools/docs/debugger-protocol)

## Objective
* get_har (c.f. https://github.com/cyrus-and/chrome-har-capturer)

```ruby
client = ChromiumRemoteDebugging::Client.new('localhost', 9222)
EM.run do
Client.pages.each do |page|
page.em_run do |socket|
socket.onopen do |handshake|
puts "onopen"
end
socket.onclose do
puts "onclose"
end
socket.onnotification "Network.dataReceived" do
puts "received Network.dataReceived notification"
end
socket.send_command "Network.getResponseBody", {"requestId" => 1} do |response|
puts response
end
end
end
end
```

## Usage
```bash
# on Mac OSX
$ "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --user-data-dir=/tmp/google_chrome --remote-debugging-port=9222
```

```ruby
[1] pry(main)> require 'chromium_remote_debugging'
=> true
[2] pry(main)> client = ChromiumRemoteDebugging::Client.new('localhost', 9222)

=> #
[3] pry(main)> client.pages
=> [#,
#,
#]
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request