Module

PhantomJS.Page

Package
purescript-phantom
Repository
purescripters/purescript-phantom

#RenderFormat Source

data RenderFormat

The type of image format when rendering a screenshot

Constructors

Instances

#RenderSettings Source

newtype RenderSettings

The type and quality of a rendered screenshot

Instances

#jpeg Source

jpeg :: RenderSettings

Predefined setting for rendering screenshot as jpeg

#png Source

png :: RenderSettings

Predefined setting for rendering screenshot as png

#Page Source

data Page :: Type

The type of a PhantomJS page context.

#createPage Source

createPage :: forall e. PhantomAff e Page

Creates a new page context.

#customHeadersRaw Source

customHeadersRaw :: forall f e. Foldable f => Page -> f (Tuple String String) -> PhantomAff e Unit

Sets custom headers on a page context. These headers will persist for the life of the context.

#open Source

open :: forall e. Page -> URL -> PhantomAff e Unit

Opens a URL in a page context.

#render Source

render :: forall e. Page -> FilePath -> RenderSettings -> PhantomAff e Unit

Renders a screenshot of the given page.

#injectJs Source

injectJs :: forall e. Page -> FilePath -> PhantomAff e Unit

Injects a javascript file into a page.

#evaluate Source

evaluate :: forall a e. Page -> String -> PhantomAff e a

Evaluates a specific function on the window object of the page. When using this function you will need to add a type annotation so PureScript knows what type the native javascript will return, e.g.

result <- evaluate page "file.js" :: forall e. Aff e (Array String)