Class: Selenium::DevTools::V130::CacheStorage

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/devtools/v130/cache_storage.rb

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ CacheStorage

Returns a new instance of CacheStorage.



26
27
28
# File 'lib/selenium/devtools/v130/cache_storage.rb', line 26

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#delete_cache(cache_id:) ⇒ Object



35
36
37
38
# File 'lib/selenium/devtools/v130/cache_storage.rb', line 35

def delete_cache(cache_id:)
  @devtools.send_cmd('CacheStorage.deleteCache',
                     cacheId: cache_id)
end

#delete_entry(cache_id:, request:) ⇒ Object



40
41
42
43
44
# File 'lib/selenium/devtools/v130/cache_storage.rb', line 40

def delete_entry(cache_id:, request:)
  @devtools.send_cmd('CacheStorage.deleteEntry',
                     cacheId: cache_id,
                     request: request)
end

#on(event, &block) ⇒ Object



30
31
32
33
# File 'lib/selenium/devtools/v130/cache_storage.rb', line 30

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

#request_cache_names(security_origin: nil, storage_key: nil, storage_bucket: nil) ⇒ Object



46
47
48
49
50
51
# File 'lib/selenium/devtools/v130/cache_storage.rb', line 46

def request_cache_names(security_origin: nil, storage_key: nil, storage_bucket: nil)
  @devtools.send_cmd('CacheStorage.requestCacheNames',
                     securityOrigin: security_origin,
                     storageKey: storage_key,
                     storageBucket: storage_bucket)
end

#request_cached_response(cache_id:, request_url:, request_headers:) ⇒ Object



53
54
55
56
57
58
# File 'lib/selenium/devtools/v130/cache_storage.rb', line 53

def request_cached_response(cache_id:, request_url:, request_headers:)
  @devtools.send_cmd('CacheStorage.requestCachedResponse',
                     cacheId: cache_id,
                     requestURL: request_url,
                     requestHeaders: request_headers)
end

#request_entries(cache_id:, skip_count: nil, page_size: nil, path_filter: nil) ⇒ Object



60
61
62
63
64
65
66
# File 'lib/selenium/devtools/v130/cache_storage.rb', line 60

def request_entries(cache_id:, skip_count: nil, page_size: nil, path_filter: nil)
  @devtools.send_cmd('CacheStorage.requestEntries',
                     cacheId: cache_id,
                     skipCount: skip_count,
                     pageSize: page_size,
                     pathFilter: path_filter)
end