webdriver
Safe HaskellNone
LanguageHaskell2010

Test.WebDriver.Profile

Description

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

Synopsis

Profiles and profile preferences

data Profile b Source #

This structure allows you to construct and manipulate profiles. This type is shared by both Firefox and Opera profiles; when a distinction must be made, the phantom type parameter is used to differentiate.

Constructors

Profile 

Fields

Instances

Instances details
FromJSON (Profile Firefox) Source # 
Instance details

Defined in Test.WebDriver.Profile

ToJSON (Profile Firefox) Source # 
Instance details

Defined in Test.WebDriver.Profile

Show (Profile b) Source # 
Instance details

Defined in Test.WebDriver.Profile

Methods

showsPrec :: Int -> Profile b -> ShowS #

show :: Profile b -> String #

showList :: [Profile b] -> ShowS #

Eq (Profile b) Source # 
Instance details

Defined in Test.WebDriver.Profile

Methods

(==) :: Profile b -> Profile b -> Bool #

(/=) :: Profile b -> Profile b -> Bool #

data ProfilePref Source #

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

class ToPref a where Source #

A typeclass to convert types to profile preference values

Methods

toPref :: a -> ProfilePref Source #

Instances

Instances details
ToPref Int16 Source # 
Instance details

Defined in Test.WebDriver.Profile

ToPref Int32 Source # 
Instance details

Defined in Test.WebDriver.Profile

ToPref Int64 Source # 
Instance details

Defined in Test.WebDriver.Profile

ToPref Int8 Source # 
Instance details

Defined in Test.WebDriver.Profile

ToPref Word16 Source # 
Instance details

Defined in Test.WebDriver.Profile

ToPref Word32 Source # 
Instance details

Defined in Test.WebDriver.Profile

ToPref Word64 Source # 
Instance details

Defined in Test.WebDriver.Profile

ToPref Word8 Source # 
Instance details

Defined in Test.WebDriver.Profile

ToPref Text Source # 
Instance details

Defined in Test.WebDriver.Profile

ToPref ProfilePref Source # 
Instance details

Defined in Test.WebDriver.Profile

ToPref Integer Source # 
Instance details

Defined in Test.WebDriver.Profile

ToPref String Source # 
Instance details

Defined in Test.WebDriver.Profile

ToPref Bool Source # 
Instance details

Defined in Test.WebDriver.Profile

ToPref Double Source # 
Instance details

Defined in Test.WebDriver.Profile

ToPref Float Source # 
Instance details

Defined in Test.WebDriver.Profile

ToPref Int Source # 
Instance details

Defined in Test.WebDriver.Profile

ToPref Word Source # 
Instance details

Defined in Test.WebDriver.Profile

Integral a => ToPref (Ratio a) Source # 
Instance details

Defined in Test.WebDriver.Profile

HasResolution r => ToPref (Fixed r) Source # 
Instance details

Defined in Test.WebDriver.Profile

Preferences

getPref :: Text -> Profile b -> Maybe ProfilePref Source #

Retrieve a preference from a profile by key name.

addPref :: ToPref a => Text -> a -> Profile b -> Profile b Source #

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

deletePref :: Text -> Profile b -> Profile b Source #

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

Extensions

hasExtension :: String -> Profile b -> Bool Source #

Determines if a profile contains the given extension. specified as an .xpi file or directory name

Miscellaneous profile operations

unionProfiles :: Profile b -> Profile b -> Profile b Source #

Takes the union of two profiles. This is the union of their HashMap fields.

onProfilePrefs :: Profile b -> (HashMap Text ProfilePref -> HashMap Text ProfilePref) -> Profile b Source #

Modifies the profilePrefs field of a profile.

Profile errors

Firefox

data Firefox Source #

Phantom type used in the parameters of Profile and PreparedProfile

defaultFirefoxProfile :: Profile Firefox Source #

Default Firefox Profile, used when no profile is supplied.

loadFirefoxProfile :: MonadIO m => FilePath -> m (Profile Firefox) Source #

Load an existing profile from the file system. Any prepared changes made to the Profile will have no effect to the profile on disk.

To make automated browser run smoothly, preferences found in defaultFirefoxProfile are automatically merged into the preferences of the on-disk profile. The on-disk profile's preference will override those found in the default profile.

saveFirefoxProfile :: MonadIO m => Profile Firefox -> FilePath -> m () Source #

Save a Firefox profile to a destination directory. This directory should already exist.

firefoxProfileToArchive :: Profile Firefox -> Archive Source #

Prepare a Firefox profile for network transmission.