Module: Ferrum
- Defined in:
- lib/ferrum/page/dom.rb,
lib/ferrum.rb,
lib/ferrum/node.rb,
lib/ferrum/page.rb,
lib/ferrum/mouse.rb,
lib/ferrum/dialog.rb,
lib/ferrum/browser.rb,
lib/ferrum/cookies.rb,
lib/ferrum/headers.rb,
lib/ferrum/network.rb,
lib/ferrum/targets.rb,
lib/ferrum/version.rb,
lib/ferrum/keyboard.rb,
lib/ferrum/page/frame.rb,
lib/ferrum/page/runtime.rb,
lib/ferrum/network/error.rb,
lib/ferrum/browser/client.rb,
lib/ferrum/browser/process.rb,
lib/ferrum/network/request.rb,
lib/ferrum/page/screenshot.rb,
lib/ferrum/network/exchange.rb,
lib/ferrum/network/response.rb,
lib/ferrum/browser/subscriber.rb,
lib/ferrum/browser/web_socket.rb,
lib/ferrum/network/intercepted_request.rb
Overview
RemoteObjectId is from a JavaScript world, and corresponds to any JavaScript object, including JS wrappers for DOM nodes. There is a way to convert between node ids and remote object ids (DOM.requestNode and DOM.resolveNode).
NodeId is used for inspection, when backend tracks the node and sends updates to the frontend. If you somehow got NodeId over protocol, backend should have pushed to the frontend all of it’s ancestors up to the Document node via DOM.setChildNodes. After that, frontend is always kept up-to-date about anything happening to the node.
BackendNodeId is just a unique identifier for a node. Obtaining it does not send any updates, for example, the node may be destroyed without any notification. This is a way to keep a reference to the Node, when you don’t necessarily want to keep track of it. One example would be linking to the node from performance data (e.g. relayout root node). BackendNodeId may be either resolved to inspected node (DOM.pushNodesByBackendIdsToFrontend) or described in more details (DOM.describeNode).
Defined Under Namespace
Classes: Browser, BrowserError, Cookies, DeadBrowserError, Dialog, EmptyTargetsError, Error, Headers, JavaScriptError, Keyboard, Mouse, Network, NoExecutionContextError, NoSuchWindowError, Node, NodeNotFoundError, NotImplementedError, Page, ScriptTimeoutError, StatusError, Targets, TimeoutError
Constant Summary
collapse
- VERSION =
"0.4"
Class Method Summary
collapse
Class Method Details
.elapsed_time(start = nil) ⇒ Object
96
97
98
|
# File 'lib/ferrum.rb', line 96
def elapsed_time(start = nil)
monotonic_time - (start || @@started)
end
|
.mac? ⇒ Boolean
84
85
86
|
# File 'lib/ferrum.rb', line 84
def mac?
RbConfig::CONFIG["host_os"] =~ /darwin/
end
|
.monotonic_time ⇒ Object
100
101
102
|
# File 'lib/ferrum.rb', line 100
def monotonic_time
Concurrent.monotonic_time
end
|
.mri? ⇒ Boolean
88
89
90
|
# File 'lib/ferrum.rb', line 88
def mri?
defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby"
end
|
.started ⇒ Object
92
93
94
|
# File 'lib/ferrum.rb', line 92
def started
@@started ||= monotonic_time
end
|
.timeout?(start, timeout) ⇒ Boolean
104
105
106
|
# File 'lib/ferrum.rb', line 104
def timeout?(start, timeout)
elapsed_time(start) > timeout
end
|
.windows? ⇒ Boolean
80
81
82
|
# File 'lib/ferrum.rb', line 80
def windows?
RbConfig::CONFIG["host_os"] =~ /mingw|mswin|cygwin/
end
|
.with_attempts(errors:, max:, wait:) ⇒ Object
108
109
110
111
112
113
114
115
116
|
# File 'lib/ferrum.rb', line 108
def with_attempts(errors:, max:, wait:)
attempts ||= 1
yield
rescue *Array(errors)
raise if attempts >= max
attempts += 1
sleep(wait)
retry
end
|