Class: Buby::ContextMenuFactory

Inherits:
Object
  • Object
show all
Includes:
Java::Burp::IContextMenuFactory
Defined in:
lib/buby/context_menu_factory.rb

Overview

Extensions can implement this interface and then call IBurpExtenderCallbacks.registerContextMenuFactory() to register a factory for custom context menu items.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.createMenuItems(invocation) ⇒ Array<JMenuItem>

Deprecated.

This method will be called by Burp when the user invokes a context menu anywhere within Burp. The factory can then provide any custom context menu items that should be displayed in the context menu, based on the details of the menu invocation. Implementations should call super

Parameters:

  • invocation (IContextMenuInvocation)

    An object the extension can query to obtain details of the context menu invocation.

Returns:

  • (Array<JMenuItem>)

    A list of custom menu items (which may include sub-menus, checkbox menu items, etc.) that should be displayed. Extensions may return nil from this method, to indicate that no menu items are required.



23
24
25
26
27
# File 'lib/buby/context_menu_factory.rb', line 23

def self.createMenuItems invocation
  pp [:got_create_menu_items, invocation] if $DEBUG
  Buby::Implants::ContextMenuInvocation.implant invocation
  nil
end

Instance Method Details

#create_menu_items(invocation) ⇒ Array<JMenuItem>

This method will be called by Burp when the user invokes a context menu anywhere within Burp. The factory can then provide any custom context menu items that should be displayed in the context menu, based on the details of the menu invocation.

Parameters:

  • invocation (IContextMenuInvocation)

    An object the extension can query to obtain details of the context menu invocation.

Returns:

  • (Array<JMenuItem>)

    A list of custom menu items (which may include sub-menus, checkbox menu items, etc.) that should be displayed. Extensions may return nil from this method, to indicate that no menu items are required.



60
61
62
# File 'lib/buby/context_menu_factory.rb', line 60

def create_menu_items invocation
  nil
end

#createMenuItems(invocation) ⇒ Array<JMenuItem>

This method will be called by Burp when the user invokes a context menu anywhere within Burp. The factory can then provide any custom context menu items that should be displayed in the context menu, based on the details of the menu invocation. This method calls create_menu_items after implanting the invocation class. Redefine to bypass this behavior

Parameters:

  • invocation (IContextMenuInvocation)

    An object the extension can query to obtain details of the context menu invocation.

Returns:

  • (Array<JMenuItem>)

    A list of custom menu items (which may include sub-menus, checkbox menu items, etc.) that should be displayed. Extensions may return nil from this method, to indicate that no menu items are required.



43
44
45
46
# File 'lib/buby/context_menu_factory.rb', line 43

def createMenuItems invocation
  pp [:got_create_menu_items, invocation] if $DEBUG
  create_menu_items Buby::Implants::ContextMenuInvocation.implant(invocation)
end