Commit f6b3b46a authored by Fred Chasen's avatar Fred Chasen
Browse files

Merge branch 'timeout' into 'master'

Implement --timeout option

See merge request !16
parents e12cd6da 6289364f
Pipeline #751 passed with stages
in 1 minute and 17 seconds
......@@ -115,6 +115,7 @@ if (typeof input === "string") {
allowedPaths: program.allowedPaths,
allowedDomains: program.allowedDomains,
additionalScripts: program.additionalScript,
timeout: program.timeout,
};
if (program.forceTransparentBackground) {
......
......@@ -26,6 +26,7 @@ class Printer extends EventEmitter {
this.ignoreHTTPSErrors = options.ignoreHTTPSErrors;
this.browserWSEndpoint = options.browserEndpoint;
this.overrideDefaultBackgroundColor = options.overrideDefaultBackgroundColor;
this.timeout = options.timeout;
this.pages = [];
}
......@@ -63,6 +64,9 @@ class Printer extends EventEmitter {
}
const page = await this.browser.newPage();
if (this.timeout) {
page.setDefaultTimeout(this.timeout);
}
if (this.overrideDefaultBackgroundColor) {
page._client.send('Emulation.setDefaultBackgroundColorOverride', { color: this.overrideDefaultBackgroundColor });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment