Class: Selenium::DevTools::V85::ApplicationCache

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/devtools/v85/application_cache.rb

Constant Summary collapse

EVENTS =
{
  application_cache_status_updated: 'applicationCacheStatusUpdated',
  network_state_updated: 'networkStateUpdated',
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ ApplicationCache

Returns a new instance of ApplicationCache.



30
31
32
# File 'lib/selenium/devtools/v85/application_cache.rb', line 30

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#enableObject



39
40
41
# File 'lib/selenium/devtools/v85/application_cache.rb', line 39

def enable
  @devtools.send_cmd('ApplicationCache.enable')
end

#get_application_cache_for_frame(frame_id:) ⇒ Object



43
44
45
46
# File 'lib/selenium/devtools/v85/application_cache.rb', line 43

def get_application_cache_for_frame(frame_id:)
  @devtools.send_cmd('ApplicationCache.getApplicationCacheForFrame',
                     frameId: frame_id)
end

#get_frames_with_manifestsObject



48
49
50
# File 'lib/selenium/devtools/v85/application_cache.rb', line 48

def get_frames_with_manifests
  @devtools.send_cmd('ApplicationCache.getFramesWithManifests')
end

#get_manifest_for_frame(frame_id:) ⇒ Object



52
53
54
55
# File 'lib/selenium/devtools/v85/application_cache.rb', line 52

def get_manifest_for_frame(frame_id:)
  @devtools.send_cmd('ApplicationCache.getManifestForFrame',
                     frameId: frame_id)
end

#on(event, &block) ⇒ Object



34
35
36
37
# File 'lib/selenium/devtools/v85/application_cache.rb', line 34

def on(event, &block)
  event = EVENTS[event] if event.is_a?(Symbol)
  @devtools.callbacks["ApplicationCache.#{event}"] << block
end