Class: Selenium::DevTools::V130::Extensions

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

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ Extensions

Returns a new instance of Extensions.



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

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#clear_storage_items(id:, storage_area:) ⇒ Object



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

def clear_storage_items(id:, storage_area:)
  @devtools.send_cmd('Extensions.clearStorageItems',
                     id: id,
                     storageArea: storage_area)
end

#get_storage_items(id:, storage_area:, keys: nil) ⇒ Object



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

def get_storage_items(id:, storage_area:, keys: nil)
  @devtools.send_cmd('Extensions.getStorageItems',
                     id: id,
                     storageArea: storage_area,
                     keys: keys)
end

#load_unpacked(path:) ⇒ Object



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

def load_unpacked(path:)
  @devtools.send_cmd('Extensions.loadUnpacked',
                     path: path)
end

#on(event, &block) ⇒ Object



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

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

#remove_storage_items(id:, storage_area:, keys:) ⇒ Object



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

def remove_storage_items(id:, storage_area:, keys:)
  @devtools.send_cmd('Extensions.removeStorageItems',
                     id: id,
                     storageArea: storage_area,
                     keys: keys)
end

#set_storage_items(id:, storage_area:, values:) ⇒ Object



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

def set_storage_items(id:, storage_area:, values:)
  @devtools.send_cmd('Extensions.setStorageItems',
                     id: id,
                     storageArea: storage_area,
                     values: values)
end