Toolbars

LocationBar

class firefox_puppeteer.ui.browser.toolbars.LocationBar(*args, **kwargs)

Provides access to and methods for the DOM elements contained in the locationbar (the text area of the ui that typically displays the current url).

autocomplete_results

Provides access to and methods for the location bar autocomplete results.

See the AutocompleteResults reference.

clear()

Clears the contents of the url bar (via the DELETE shortcut).

close_context_menu()

Closes the Location Bar context menu by a key event.

connection_icon

Provides access to the urlbar connection icon.

Returns:Reference to the connection icon element.
contextmenu

Provides access to the urlbar context menu.

Returns:Reference to the urlbar context menu.
focus(event='click')

Focus the location bar according to the provided event.

Parameters:eventt – The event to synthesize in order to focus the urlbar (one of click or shortcut).
focused

Checks the focus state of the location bar.

Returns:True if focused, otherwise False
get_contextmenu_entry(action)

Retrieves the urlbar context menu entry corresponding to the given action.

Parameters:action – The action corresponding to the retrieved value.
Returns:Reference to the urlbar contextmenu entry.
history_drop_marker

Provides access to the history drop marker.

Returns:Reference to the history drop marker.
identity_box

The DOM element which represents the identity box.

Returns:Reference to the identity box.
identity_country_label

The DOM element which represents the identity icon country label.

Returns:Reference to the identity icon country label.
identity_icon

Provides access to the urlbar identity icon.

Returns:Reference to the identity icon element.
identity_organization_label

The DOM element which represents the identity icon label.

Returns:Reference to the identity icon label.
identity_popup

Provides utility members for accessing and manipulating the identity popup.

See the IdentityPopup reference.

load_url(url)

Load the specified url in the location bar by synthesized keystrokes.

Parameters:url – The url to load.
notification_popup

Provides access to the DOM element notification popup.

Returns:Reference to the notification popup.
open_identity_popup()

Open the identity popup.

reload_button

Provides access to the DOM element reload button.

Returns:Reference to the reload button.
reload_url(trigger='button', force=False)

Reload the currently open page.

Parameters:
  • trigger – The event type to use to cause the reload (one of shortcut, shortcut2, or button).
  • force – Whether to cause a forced reload.
stop_button

Provides access to the DOM element stop button.

Returns:Reference to the stop button.
urlbar

Provides access to the DOM element urlbar.

Returns:Reference to the url bar.
urlbar_input

Provides access to the urlbar input element.

Returns:Reference to the urlbar input.
value

Provides access to the currently displayed value of the urlbar.

Returns:The urlbar value.

AutocompleteResults

class firefox_puppeteer.ui.browser.toolbars.AutocompleteResults(marionette, window, element)

Wraps DOM elements and methods for interacting with autocomplete results.

close(force=False)

Closes the urlbar autocomplete popup.

Parameters:force – If true, the popup is closed by its own hide function, otherwise a key event is sent to close the popup.
get_matching_text(result, match_type)

Returns an array of strings of the matching text within an autocomplete result in the urlbar.

Parameters:
  • result – The result to inspect for matches.
  • match_type – The type of match to search for (one of title or url).
is_complete

Returns when this popup is open and autocomplete results are complete.

Returns:True, when autocomplete results have been populated.
is_open

Returns whether this popup is currently open.

Returns:True when the popup is open, otherwise false.
results
Returns:The autocomplete result container node.
selected_index

Provides the index of the selected item in the autocomplete list.

Returns:The index.
visible_results

Supplies the list of visible autocomplete result nodes.

Returns:The list of visible results.

IdentityPopup

class firefox_puppeteer.ui.browser.toolbars.IdentityPopup(*args, **kwargs)

Wraps DOM elements and methods for interacting with the identity popup.

close(force=False)

Closes the identity popup by hitting the escape key.

Parameters:force – Optional, If True force close the popup. Defaults to False
is_open

Returns whether this popup is currently open.

Returns:True when the popup is open, otherwise false.
view

Provides utility members for accessing and manipulating the identity popup’s multi view.

See the IdentityPopupMultiView reference.