Skip to content

Commit bf13727

Browse files
committed
fix: Allow for loading local files when creating screenshots and wait for the page to load before taking screenshot.
1 parent 85d37d9 commit bf13727

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/gulp/screenshot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ module.exports = function(gulp, options) {
4747
}
4848

4949
const openBrowser = async () => {
50-
const browser = await puppeteer.launch();
50+
const browser = await puppeteer.launch({ args:['--allow-file-access-from-files'] });
5151
return browser;
5252
};
5353

5454
const renderPage = async (browser, url, output) => {
5555
const page = await browser.newPage();
5656
await page.emulate(iPad);
57-
await page.goto(url + '#screenshot');
57+
await page.goto(url + '#screenshot', { waitUntil: 'networkidle0' });
5858
await page.screenshot({path: output + '.png'});
5959
};
6060

0 commit comments

Comments
 (0)