webdriver.firefox.firefox_profile

Module Contents

Classes

AddonFormatError() Exception for not well-formed add-on manifest files
FirefoxProfile(self,profile_directory=None)
class AddonFormatError

Exception for not well-formed add-on manifest files

class FirefoxProfile(profile_directory=None)
__init__(profile_directory=None)

Initialises a new instance of a Firefox Profile

Args:
  • profile_directory: Directory of profile that you want to use. This defaults to None and will create a new directory when object is created.
set_preference(key, value)

sets the preference that we want in the profile.

add_extension(extension=WEBDRIVER_EXT)
update_preferences()
path()

Gets the profile directory that is currently being used

port()

Gets the port that WebDriver is working on

port(port)

Sets the port that WebDriver will be running on

accept_untrusted_certs()
accept_untrusted_certs(value)
assume_untrusted_cert_issuer()
assume_untrusted_cert_issuer(value)
native_events_enabled()
native_events_enabled(value)
encoded()

A zipped, base64 encoded string of profile directory for use with remote WebDriver JSON wire protocol

set_proxy(proxy)
_set_manual_proxy_preference(key, setting)
_create_tempfolder()

Creates a temp folder to store User.js and the extension

_write_user_prefs(user_prefs)

writes the current user prefs dictionary to disk

_read_existing_userjs(userjs)
_install_extension(addon, unpack=True)

Installs addon from a filepath, url or directory of addons in the profile. - path: url, absolute path to .xpi, or directory of addons - unpack: whether to unpack unless specified otherwise in the install.rdf

_addon_details(addon_path)

Returns a dictionary of details about the addon.

Parameters:addon_path – path to the add-on directory or XPI

Returns:

{'id':      u'rainbow@colors.org', # id of the addon
 'version': u'1.4',                # version of the addon
 'name':    u'Rainbow',            # name of the addon
 'unpack':  False }                # whether to unpack the addon