Class: Selenium::DevTools::V147::WebMCP
- Inherits:
-
Object
- Object
- Selenium::DevTools::V147::WebMCP
- Defined in:
- lib/selenium/devtools/v147/web_mcp.rb
Constant Summary collapse
- EVENTS =
{ tools_added: 'toolsAdded', tools_removed: 'toolsRemoved', }.freeze
Instance Method Summary collapse
- #enable ⇒ Object
-
#initialize(devtools) ⇒ WebMCP
constructor
A new instance of WebMCP.
- #on(event, &block) ⇒ Object
Constructor Details
#initialize(devtools) ⇒ WebMCP
Returns a new instance of WebMCP.
30 31 32 |
# File 'lib/selenium/devtools/v147/web_mcp.rb', line 30 def initialize(devtools) @devtools = devtools end |
Instance Method Details
#enable ⇒ Object
39 40 41 |
# File 'lib/selenium/devtools/v147/web_mcp.rb', line 39 def enable @devtools.send_cmd('WebMCP.enable') end |
#on(event, &block) ⇒ Object
34 35 36 37 |
# File 'lib/selenium/devtools/v147/web_mcp.rb', line 34 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["WebMCP.#{event}"] << block end |