Module

Toppokki

#Puppeteer

#Browser

data Browser

#Page

data Page

#ElementHandle

#ConsoleMessage

#ChromeAWS

#URL

newtype URL

Constructors

Instances

#Selector

newtype Selector

Constructors

Instances

#LaunchOptions

type LaunchOptions :: Row Typetype LaunchOptions = (args :: Array String, defaultViewport :: Record DefaultViewPort, devtools :: Boolean, dumpio :: Boolean, executablePath :: String, handleSIGHUP :: Boolean, handleSIGINT :: Boolean, handleSIGTERM :: Boolean, headless :: Boolean, ignoreDefaultArgs :: Array String, ignoreHTTPSErrors :: Boolean, pipe :: Boolean, slowMo :: Number, timeout :: Number, userDataDir :: String)

#DefaultViewPort

type DefaultViewPort :: Row Typetype DefaultViewPort = (deviceScaleFactor :: Number, hasTouch :: Boolean, height :: Number, isLandscape :: Boolean, isMobile :: Boolean, width :: Number)

#launch

launch :: forall options trash. Union options trash LaunchOptions => Record options -> Aff Browser

#launchChromeAWS

launchChromeAWS :: forall options trash. Union options trash LaunchOptions => ChromeAWS -> Record options -> Aff Browser

#newPage

#pages

#goto

goto :: URL -> Page -> Aff Unit

#close

#content

#ScreenshotOptions

type ScreenshotOptions :: Row Typetype ScreenshotOptions = (clip :: { height :: Int, width :: Int, x :: Int, y :: Int }, fullPage :: Boolean, omitBackground :: Boolean, path :: String, quality :: Int, type :: String)

#screenshot

screenshot :: forall options trash. Union options trash ScreenshotOptions => Record options -> Page -> Aff Buffer

#PDFMargin

#PDFMarginOptions

type PDFMarginOptions :: Row Typetype PDFMarginOptions = (bottom :: String, left :: String, right :: String, top :: String)

#makePDFMargin

makePDFMargin :: forall options trash. Union options trash PDFMarginOptions => Record options -> PDFMargin

#PDFOptions

type PDFOptions :: Row Typetype PDFOptions = (displayHeaderFooter :: Boolean, footerTemplate :: String, format :: String, headerTemplate :: String, height :: String, landscape :: Boolean, margin :: PDFMargin, pageRanges :: String, path :: String, printBackground :: Boolean, scale :: Int, width :: String)

#pdf

pdf :: forall options trash. Union options trash PDFOptions => Record options -> Page -> Aff Buffer

#pageWaitForSelector

pageWaitForSelector :: forall options trash. Union options trash (hidden :: Boolean, timeout :: Int, visible :: Boolean) => Selector -> Record options -> Page -> Aff ElementHandle

#focus

#select

select :: Selector -> String -> Page -> Aff Unit

Select a specific option in select dropdown group.

#type_

type_ :: forall options trash. Union options trash (delay :: Int) => Selector -> String -> Record options -> Page -> Aff Unit

#click

#WaitUntilOption

#waitForNavigation

waitForNavigation :: forall options trash. Union options trash (waitUntil :: WaitUntilOption) => Record options -> Page -> Aff Unit

#getLocationRef

#unsafeEvaluateOnNewDocument

unsafeEvaluateOnNewDocument :: String -> Page -> Aff Foreign

The function is invoked after the document was created but before any of its scripts were run.

This is useful to amend the environment, e.g. to seed Math.random.

#unsafeEvaluateStringFunction

#unsafePageEval

unsafePageEval :: Selector -> String -> Page -> Aff Foreign

This method runs document.querySelector within the page and passes it as the first argument to pageFunction. If there's no element matching selector, the method throws an error.

Second argument is a pageFunction which should be a valid JavaScript function written as a string which we unsafely eval.

If pageFunction returns a Promise, then page.$$eval would wait for the promise to resolve and return its value.

#unsafePageEvalAll

unsafePageEvalAll :: Selector -> String -> Page -> Aff Foreign

This method runs Array.from(document.querySelectorAll(selector)) within the page and passes it as the first argument to pageFunction.

Second argument is a pageFunction which should be a valid JavaScript function written as a string which we unsafely eval.

If pageFunction returns a Promise, then page.$$eval would wait for the promise to resolve and return its value.

#runPromiseAffE1

runPromiseAffE1 :: forall a o. Fn1 a (Effect (Promise o)) -> a -> Aff o

#runPromiseAffE2

runPromiseAffE2 :: forall a b o. Fn2 a b (Effect (Promise o)) -> a -> b -> Aff o

#runPromiseAffE3

runPromiseAffE3 :: forall a b c o. Fn3 a b c (Effect (Promise o)) -> a -> b -> c -> Aff o

#runPromiseAffE4

runPromiseAffE4 :: forall a b c d o. Fn4 a b c d (Effect (Promise o)) -> a -> b -> c -> d -> Aff o

#KeyboardKey

newtype KeyboardKey

See USKeyboardLayout for a list of all key names.

Constructors

#keyboardDown

keyboardDown :: forall options trash. Union options trash (text :: String) => KeyboardKey -> Record options -> Page -> Aff Unit

Dispatches a keydown event.

#keyboardPress

keyboardPress :: forall options trash. Union options trash (delay :: Int, text :: String) => KeyboardKey -> Record options -> Page -> Aff Unit

Trigger a single keypress. Shortcut for keyboard.down and keyboard.up.

#keyboardSendCharacter

keyboardSendCharacter :: String -> Page -> Aff Unit

Dispatches a keypress and input event. This does not send a keydown or keyup event.

#keyboardType

keyboardType :: forall options trash. Union options trash (delay :: Number) => String -> Record options -> Page -> Aff Unit

Sends a keydown, keypress/input, and keyup event for each character in the text. To press a special key, like Control or ArrowDown, use keyboard.press.

#keyboardUp

keyboardUp :: forall options trash. Union options trash (text :: String) => KeyboardKey -> Record options -> Page -> Aff Unit

Dispatches a keyup event.

#setViewport

#setUserAgent

setUserAgent :: String -> Page -> Aff Unit

Specific user agent to use in this page

#bringToFront

bringToFront :: Page -> Aff Unit

Brings page to front (activates tab)

#addScriptTag

#consoleMessageText

#puppeteer

#_puppeteer

#_launch

_launch :: forall options. Fn1 options (Effect (Promise Browser))

#_launchChromeAWS

_launchChromeAWS :: forall options. Fn2 ChromeAWS options (Effect (Promise Browser))

#_screenshot

_screenshot :: forall options. Fn2 options Page (Effect (Promise Buffer))

#_pdf

_pdf :: forall options. Fn2 options Page (Effect (Promise Buffer))

#_on

#_pageWaitForSelector

#_select

_select :: forall options. Fn3 Selector options Page (Effect (Promise Unit))

#_type

_type :: forall options. Fn4 Selector String options Page (Effect (Promise Unit))

#_waitForNavigation

_waitForNavigation :: forall options. Fn2 options Page (Effect (Promise Unit))

#_getLocationHref

#_unsafeEvaluateOnNewDocument

#_unsafeEvaluateStringFunction

#_keyboardDown

_keyboardDown :: forall options. Fn3 KeyboardKey options Page (Effect (Promise Unit))

#_keyboardPress

_keyboardPress :: forall options. Fn3 KeyboardKey options Page (Effect (Promise Unit))

#_keyboardSendCharacter

#_keyboardType

_keyboardType :: forall options. Fn3 String options Page (Effect (Promise Unit))

#_keyboardUp

_keyboardUp :: forall options. Fn3 KeyboardKey options Page (Effect (Promise Unit))

#_bringToFront

Modules