![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Ruby gem for driving Google Chrome and possibly other WebKit-based browsers via the WebKit remote debugging protocol.
This gem can be used to test Web pages in real browsers with minimal intrusion.
Compared to PhantomJS, webkit_remote
tests will take
longer, but provide assurance that the code will run as intended on desktop and
mobile browsers, and can exercise HTML5 features that are not yet
supported by Phantom.
Compared to Selenium, webkit_remote
is less mature,
and only supports WebKit-based browsers. In return, the gem can support
(either directly or via extensions) features that have not made their way into
Selenium's WebDriver.
Currently, the following sections of the WebKit remote debugging protocol have been implemented:
This gem will only support officially released remote debugging protocol features. If you need to use an unsupported feature, such as CSS debugging, take a look at the webkit_remote_unstable gem.
The gem is tested against the OSX and Linux builds of Google Chrome. The only platform-dependent functionality is launching and shutting down the browser process, everything else should work for any WebKit-based browser that implements the remote debugging protocol.
Google Chrome 60 and above can be used in headless mode.
Use RubyGems.
gem install webkit_remote
This section only showcases a few features. Read the YARD docs to see everything this gem has to offer.
client = WebkitRemote.local
launches a separate instance of Google Chrome that is not connected to your profile, and sets up a connection to it. Alternatively,
client = WebkitRemote.remote host: 'phone-ip-here', port: 9222
connects to a remote WebKit instance running on a phone.
client.page_events = true
client.navigate_to 'http://translate.google.com'
client.wait_for(type: WebkitRemote::Event::PageLoaded).last
Evaluate some JavaScript.
element = client.remote_eval 'document.querySelector("[name=text]")'
Take a look at the result.
element.js_class_name
element.description
element.properties[:tagName].value
element.properties[:tagName].writable?
Pass an object to some JavaScript code.
js_code = <<END_JS
function(element, value) {
element.value = value;
return "Check the browser window";
}
END_JS
client.remote_eval('window').bound_call js_code, element, '你好'
Finally, release the WebKit state that the debugger is holding onto.
client.clear_all
Produce some console output.
client.console_events = true
client.remote_eval '(function() { console.warn("hello ruby"); })();'
Take a look at it.
client.wait_for type: WebkitRemote::Event::ConsoleMessage
message = client.console_messages.first
message.text
message.level
message.params
message.stack_trace
Again, release the WebKit state.
client.clear_all
Record network requests and reload the page.
client.page_events = true
client.network_events = true
client.clear_cache
client.clear_cookies
client.navigate_to 'http://translate.google.com'
client.wait_for(type: WebkitRemote::Event::PageLoaded).last
See the network traffic generated by the page.
client.network_resources.length
resource = client.network_resources.first
resource.canceled
resource.type
resource.request.url
resource.request.headers
resource.response.mime_type
resource.response.url
resource.response.status
resource.response.headers
resource.body
Clean up.
client.clear_all
Find a node and inspect its attributes.
node = client.dom_root.query_selector '[name=text]'
node.attributes['name']
node.attributes['id']
Get the JavaScript DOM object for the node and explore its properties.
node.js_object.properties['nodeName'].value
client.close
closes the debugging connection and shuts down the Google Chrome instance.
Please contribute support for stable features to webkit_remote and support for unstable features at webkit_remote_unstable.
Copyright (c) 2012 Victor Costan. See LICENSE.txt for further details.
FAQs
Unknown package
We found that webkit_remote demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.