fix(core): update

This commit is contained in:
Philipp Kunz 2019-05-29 19:17:39 +02:00
parent 58d923b14c
commit 1537705cde
4 changed files with 2 additions and 0 deletions

View File

@ -76,6 +76,7 @@ export class SmartPdf {
async getPdfForWebsite(websiteUrl: string) { async getPdfForWebsite(websiteUrl: string) {
const page = await this.headlessBrowser.newPage(); const page = await this.headlessBrowser.newPage();
page.emulateMedia('screen');
const response = await page.goto(websiteUrl, { waitUntil: 'networkidle2' }); const response = await page.goto(websiteUrl, { waitUntil: 'networkidle2' });
const pdfId = plugins.smartunique.shortId(); const pdfId = plugins.smartunique.shortId();
await page.pdf({ await page.pdf({
@ -90,6 +91,7 @@ export class SmartPdf {
async getFullWebsiteAsSinglePdf(websiteUrl: string) { async getFullWebsiteAsSinglePdf(websiteUrl: string) {
const page = await this.headlessBrowser.newPage(); const page = await this.headlessBrowser.newPage();
page.emulateMedia('screen');
const response = await page.goto(websiteUrl, { waitUntil: 'networkidle2' }); const response = await page.goto(websiteUrl, { waitUntil: 'networkidle2' });
const pdfId = plugins.smartunique.shortId(); const pdfId = plugins.smartunique.shortId();
const {documentHeight, documentWidth} = await page.evaluate(() => { const {documentHeight, documentWidth} = await page.evaluate(() => {