Merge pull request #445 from jan-tee/main

Added env var switch to support screen captures from HTTPS sites with untrusted certificates
This commit is contained in:
Daniel
2024-02-03 16:36:01 +03:30
committed by GitHub
4 changed files with 8 additions and 3 deletions
+5 -1
View File
@@ -21,7 +21,11 @@ const BROWSER_TIMEOUT = Number(process.env.BROWSER_TIMEOUT) || 5;
export default async function archiveHandler(link: LinksAndCollectionAndOwner) {
const browser = await chromium.launch();
const context = await browser.newContext(devices["Desktop Chrome"]);
const context = await browser.newContext({
...devices["Desktop Chrome"],
ignoreHTTPSErrors:
process.env.IGNORE_HTTPS_ERRORS === "true",
});
const page = await context.newPage();
const timeoutPromise = new Promise((_, reject) => {