Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Review fork customization #11

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/core/render-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,21 @@ async function getFullPageHeight(page) {
async function render(_opts = {}) {
const opts = _.merge({
cookies: [],
scrollPage: false,
scrollPage: true,
emulateScreenMedia: true,
ignoreHttpsErrors: false,
ignoreHttpsErrors: true,
html: null,
viewport: {
width: 1600,
height: 1200,
},
goto: {
waitUntil: 'networkidle0',
timout: 120000
},
output: 'pdf',
pdf: {
format: 'A4',
format: 'letter',
printBackground: true,
},
screenshot: {
Expand Down Expand Up @@ -230,7 +231,7 @@ async function scrollPage(page) {
setTimeout(scrollDown, scrollInterval);
}

setTimeout(reject, 30000);
setTimeout(reject, 120000);
scrollDown();
});
});
Expand All @@ -242,6 +243,10 @@ function logOpts(opts) {
supressedOpts.html = '...';
}

if (opts.url && opts.url.length > 1024) {
supressedOpts.url = opts.url.slice(0, 300);
}

logger.info(`Rendering with opts: ${JSON.stringify(supressedOpts, null, 2)}`);
}

Expand Down
2 changes: 1 addition & 1 deletion src/middleware/error-logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function getLogLevel(status) {
function logRequestDetails(logLevel, req) {
logger[logLevel]('Request headers:', deepSupressLongStrings(req.headers));
logger[logLevel]('Request parameters:', deepSupressLongStrings(req.params));
logger[logLevel]('Request body:', req.body);
logger[logLevel]('Request body:', deepSupressLongStrings(req.body));
}

function deepSupressLongStrings(obj) {
Expand Down