Skip to content

Commit

Permalink
[pdfx] switch to sparticuz/chromium
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Jan 3, 2024
1 parent 1bf4e54 commit 0f86734
Show file tree
Hide file tree
Showing 3 changed files with 1,263 additions and 921 deletions.
8 changes: 4 additions & 4 deletions services/pdfx/api/_lib/chromium.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Puppeteer, { Browser } from "puppeteer-core";
import chromeAws from "chrome-aws-lambda";
import Puppeteer, { Browser, PuppeteerLaunchOptions } from "puppeteer-core";
import chromeAws from "@sparticuz/chromium";

export async function createBrowser(args: ChromeLaunchOptions = {}): Promise<Browser> {
const defaults: ChromeLaunchOptions = {
ignoreHTTPSErrors: true,
};
let options: ChromeLaunchOptions = {};
let options: PuppeteerLaunchOptions = {};

if (isDev()) {
options = {
Expand All @@ -23,7 +23,7 @@ export async function createBrowser(args: ChromeLaunchOptions = {}): Promise<Bro
...args,
...{
args: chromeAws.args,
executablePath: await chromeAws.executablePath,
executablePath: await chromeAws.executablePath(),
headless: chromeAws.headless,
}
};
Expand Down
Loading

0 comments on commit 0f86734

Please sign in to comment.