Module: Ferrum
- Defined in:
- lib/ferrum/frame/dom.rb,
lib/ferrum.rb,
lib/ferrum/node.rb,
lib/ferrum/page.rb,
lib/ferrum/frame.rb,
lib/ferrum/mouse.rb,
lib/ferrum/dialog.rb,
lib/ferrum/target.rb,
lib/ferrum/browser.rb,
lib/ferrum/context.rb,
lib/ferrum/cookies.rb,
lib/ferrum/headers.rb,
lib/ferrum/network.rb,
lib/ferrum/version.rb,
lib/ferrum/contexts.rb,
lib/ferrum/keyboard.rb,
lib/ferrum/page/frames.rb,
lib/ferrum/frame/runtime.rb,
lib/ferrum/network/error.rb,
lib/ferrum/browser/chrome.rb,
lib/ferrum/browser/client.rb,
lib/ferrum/browser/command.rb,
lib/ferrum/browser/firefox.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/auth_request.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, Context, Contexts, Cookies, DeadBrowserError, Dialog, Error, Frame, Headers, JavaScriptError, Keyboard, Mouse, Network, NoExecutionContextError, NoSuchPageError, NoSuchTargetError, Node, NodeNotFoundError, NotImplementedError, Page, ScriptTimeoutError, StatusError, Target, TimeoutError
Constant Summary
collapse
- VERSION =
"0.7"
Class Method Summary
collapse
Class Method Details
.elapsed_time(start = nil) ⇒ Object
97
98
99
|
# File 'lib/ferrum.rb', line 97
def elapsed_time(start = nil)
monotonic_time - (start || @@started)
end
|
.mac? ⇒ Boolean
85
86
87
|
# File 'lib/ferrum.rb', line 85
def mac?
RbConfig::CONFIG["host_os"] =~ /darwin/
end
|
.monotonic_time ⇒ Object
101
102
103
|
# File 'lib/ferrum.rb', line 101
def monotonic_time
Concurrent.monotonic_time
end
|
.mri? ⇒ Boolean
89
90
91
|
# File 'lib/ferrum.rb', line 89
def mri?
defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby"
end
|
.started ⇒ Object
93
94
95
|
# File 'lib/ferrum.rb', line 93
def started
@@started ||= monotonic_time
end
|
.timeout?(start, timeout) ⇒ Boolean
105
106
107
|
# File 'lib/ferrum.rb', line 105
def timeout?(start, timeout)
elapsed_time(start) > timeout
end
|
.windows? ⇒ Boolean
81
82
83
|
# File 'lib/ferrum.rb', line 81
def windows?
RbConfig::CONFIG["host_os"] =~ /mingw|mswin|cygwin/
end
|
.with_attempts(errors:, max:, wait:) ⇒ Object
109
110
111
112
113
114
115
116
117
|
# File 'lib/ferrum.rb', line 109
def with_attempts(errors:, max:, wait:)
attempts ||= 1
yield
rescue *Array(errors)
raise if attempts >= max
attempts += 1
sleep(wait)
retry
end
|