Class: Selenium::DevTools::V131::Preload
- Inherits:
-
Object
- Object
- Selenium::DevTools::V131::Preload
- Defined in:
- lib/selenium/devtools/v131/preload.rb
Constant Summary collapse
- EVENTS =
{ rule_set_updated: 'ruleSetUpdated', rule_set_removed: 'ruleSetRemoved', preload_enabled_state_updated: 'preloadEnabledStateUpdated', prefetch_status_updated: 'prefetchStatusUpdated', prerender_status_updated: 'prerenderStatusUpdated', preloading_attempt_sources_updated: 'preloadingAttemptSourcesUpdated', }.freeze
Instance Method Summary collapse
- #disable ⇒ Object
- #enable ⇒ Object
-
#initialize(devtools) ⇒ Preload
constructor
A new instance of Preload.
- #on(event, &block) ⇒ Object
Constructor Details
#initialize(devtools) ⇒ Preload
Returns a new instance of Preload.
34 35 36 |
# File 'lib/selenium/devtools/v131/preload.rb', line 34 def initialize(devtools) @devtools = devtools end |
Instance Method Details
#disable ⇒ Object
47 48 49 |
# File 'lib/selenium/devtools/v131/preload.rb', line 47 def disable @devtools.send_cmd('Preload.disable') end |
#enable ⇒ Object
43 44 45 |
# File 'lib/selenium/devtools/v131/preload.rb', line 43 def enable @devtools.send_cmd('Preload.enable') end |
#on(event, &block) ⇒ Object
38 39 40 41 |
# File 'lib/selenium/devtools/v131/preload.rb', line 38 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["Preload.#{event}"] << block end |