Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ryotarai/chromium_remote_debugging
https://github.com/ryotarai/chromium_remote_debugging
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ryotarai/chromium_remote_debugging
- Owner: ryotarai
- License: mit
- Created: 2013-01-31T16:11:55.000Z (almost 12 years ago)
- Default Branch: develop
- Last Pushed: 2013-07-03T12:37:18.000Z (over 11 years ago)
- Last Synced: 2024-11-07T17:04:16.304Z (about 2 months ago)
- Language: Ruby
- Size: 126 KB
- Stars: 1
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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