webdriver-0.3.0.1: a Haskell client for the Selenium WebDriver protocol

Safe HaskellNone

Test.WebDriver.Common.Profile

Description

A type for profile preferences. These preference values are used by both Firefox and Opera profiles.

Synopsis

Documentation

data Profile b Source

This structure allows you to construct and manipulate profiles in pure code, deferring execution of IO operations until the profile is "prepared". This type is shared by both Firefox and Opera profile code; when a distinction must be made, the phantom type parameter is used to differentiate.

Constructors

Profile 

Fields

profileDir :: FilePath

Location of the profile in the local file system

profileExts :: HashSet FilePath

A set of filepaths pointing to browser extensions.

profilePrefs :: HashMap Text ProfilePref

A map of Firefox preferences. These are the settings found in the profile's prefs.js, and entries found in about:config

Instances

Eq (Profile b) 
Show (Profile b) 

newtype PreparedProfile b Source

Represents a profile that has been prepared for network transmission. The profile cannot be modified in this form.

data ProfilePref Source

A profile preference value. This is the subset of JSON values that excludes arrays, objects, and null.

class ToPref a whereSource

A typeclass to convert types to profile preference values

Methods

toPref :: a -> ProfilePrefSource

getPref :: Text -> Profile b -> Maybe ProfilePrefSource

Retrieve a preference from a profile by key name.

addPref :: ToPref a => Text -> a -> Profile b -> Profile bSource

Add a new preference entry to a profile, overwriting any existing entry with the same key.

deletePref :: Text -> Profile b -> Profile bSource

Delete an existing preference entry from a profile. This operation is silent if the preference wasn't found.

addExtension :: FilePath -> Profile b -> Profile bSource

Add a new extension to the profile. The file path should refer to an .xpi file or an extension directory. This operation has no effect if the same extension has already been added to this profile.

deleteExtension :: FilePath -> Profile b -> Profile bSource

Delete an existing extension from the profile. The file path should refer to an .xpi file or an extension directory. This operation has no effect if the extension was never added to the profile.

newtype ProfileParseError Source

An error occured while attempting to parse a profile's preference file.