Options
All
  • Public
  • Public/Protected
  • All
Menu

settings related to requesting internet resources (your page and resources referenced by your page)

Hierarchy

  • IRequestSettings

Index

Properties

Optional authentication

authentication: object

username/password for simple HTTP authentication

Type declaration

  • password: string
  • userName: string

Optional clearCache

clearCache: boolean

if true, clears cache between chained IPageRequest navigations. note: only important if multiple pages are navigated in one IUserRequest. cache is never shared between api calls.

default

false

Optional clearCookies

clearCookies: boolean

if true, clears all cookies upon initial navigation to the targetUrl. consider using the deleteCookies property for targeted removals. note: only important if multiple pages are navigated in one IUserRequest. cookies are never shared between api calls.

default

false

Optional cookies

cookies: ICookie[]

You must specify name, value, and either domain or url. Set Cookies for any domain, prior to loading this IPageRequest. If a cookie already exists with the same domain+path+name combination, it will be replaced. See ICookie for documentation on the cookie parameters.

Optional customHeaders

customHeaders: object

BEWARE: setting custom headers can corrupt your request. use with care. specify additional request headers here. They will be sent to the server for every request issued (the page and resources). Unicode is not supported (ASCII only) example: customHeaders:{"myHeader":"myValue","yourHeader":"someValue"} if you want to set headers for just the target page (and not every sub-request) use the IUrlSettings.headers parameter.

Type declaration

  • [key: string]: string

Optional deleteCookies

deleteCookies: string[]

delete any cookie with a matching "name" property before processing the request.

Optional disableJavascript

disableJavascript: boolean

set to true to disable all Javascript from being processed on your page.

Optional emulateDevice

emulateDevice: "random" | "iPhone 4" | "iPhone 4 landscape" | "iPhone X" | "iPhone X landscape" | "Nexus 4" | "Nexus 4 landscape" | "Nexus 10" | "Nexus 10 landscape" | "Windows IE11 1080p" | "Windows IE11 1080p landscape" | "Surface 3 Chrome" | "Surface 3 Chrome landscape" | "googlebot"

new for Chrome backend (not supported in WebKit). if set, will override the viewport and useragent.

Optional ignoreImages

ignoreImages: boolean

set to true to skip loading of inlined images. If you are not outputing a screenshot, you can usually set this to true, which will decrease load times.

Optional maxWait

maxWait: number

the maximum amount of time (ms timeout) you wish to wait for the page to finish loading. When rendering a page, we will give you whatever is ready at this time (page may be incompletely loaded). Can be increased up to 5 minutes (300000) , but that only should be used as a last resort, as it is a relatively expensive page render (you are billed for render time). if this value is exceeded, the current page will be rendered and statusCode 424 returned.

Optional resourceModifier

resourceModifier: IResourceModifier[]

array of regex + adjustment parametes for modifying or rejecting resources being loaded by the webpage. Example: "resourceModifier": [{regex:".*css.*",isBlacklisted:true}{"regex": "http://mydomain.com.*","setHeader": {"hello": "world","Accept-encoding": "tacos"}}]

Optional resourceTimeout

resourceTimeout: number

maximum amount of time to wait for each external resource to load. we kill the request if it exceeds this amount.

Optional resourceWait

resourceWait: number

maximum amount of time (in ms) to wait for each external resources to load. (.js, .png, etc) if the time exceeds this, we don't cancel the resource request, but we don't delay rendering the IPageRequest if everything else is done.

Optional stopOnError

stopOnError: boolean

if true, will stop IPageRequest load upon the first error detected, and move to next phase (render or next page)

Optional userAgent

userAgent: string

default useragent is "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/534.34 (KHTML, like Gecko) Safari/534.34 PhantomJS/2.0.0 (PhantomJsCloud.com/2.0.1)"

Optional waitInterval

waitInterval: number

Milliseconds to delay rendering after the last resource is finished loading (default is 1000ms). This is useful in case there are any AJAX requests or animations that need to finish up. If additional network requests are made while we are waiting, the waitInterval will restart once finished again. This can safely be set to 0 if you know there are no AJAX or animations you need to wait for (decreasing your billed costs)

Optional webSecurityEnabled

webSecurityEnabled: boolean

set to true to enable web security. IMPORTANT: only the first IPageRequest can set this property, and it is reused for the remainder of your request.

default

false

Optional xssAuditingEnabled

xssAuditingEnabled: boolean

set to true to prohibit cross-site scripting attempts (XSS)

default

false