Skip to content

Commit dbfee6f

Browse files
committed
Wait networkidle0 event by default
1 parent 35cfa7e commit dbfee6f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = launchOpts => {
1212
const newPage = () =>
1313
Promise.resolve(browser).then(browser => browser.newPage())
1414

15-
const text = async (url, opts = {}) => {
15+
const text = async (url, opts = { waitUntil: 'networkidle0' }) => {
1616
const page = await newPage()
1717

1818
await page.goto(url, opts)
@@ -22,7 +22,7 @@ module.exports = launchOpts => {
2222
return text
2323
}
2424

25-
const html = async (url, opts = {}) => {
25+
const html = async (url, opts = { waitUntil: 'networkidle0' }) => {
2626
const page = await newPage()
2727

2828
await page.goto(url, opts)
@@ -32,7 +32,7 @@ module.exports = launchOpts => {
3232
return content
3333
}
3434

35-
const screenshot = async (url, opts = {}) => {
35+
const screenshot = async (url, opts = { waitUntil: 'networkidle0' }) => {
3636
const {
3737
tmpOpts,
3838
type = 'png',
@@ -58,7 +58,7 @@ module.exports = launchOpts => {
5858
return Promise.resolve(tempFile)
5959
}
6060

61-
const pdf = async (url, opts = {}) => {
61+
const pdf = async (url, opts = { waitUntil: 'networkidle0' }) => {
6262
const {
6363
tmpOpts,
6464
media = 'screen',

0 commit comments

Comments
 (0)