From 3dbaadb5900b88c8e6fe3badc8c05b5019133db5 Mon Sep 17 00:00:00 2001 From: le0m Date: Fri, 13 Sep 2024 16:11:18 +0200 Subject: [PATCH] fix: create a separate browser context when printing a PDF --- print2pdf/print2pdf.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/print2pdf/print2pdf.go b/print2pdf/print2pdf.go index 94e446c..322920e 100644 --- a/print2pdf/print2pdf.go +++ b/print2pdf/print2pdf.go @@ -279,7 +279,7 @@ func PrintPDF(ctx context.Context, data GetPDFParams, h PDFHandler) (string, err media = data.Media } - tabCtx, tabCancel := chromedp.NewContext(browserCtx) + tabCtx, tabCancel := chromedp.NewContext(browserCtx, chromedp.WithNewBrowserContext()) defer tabCancel() // Cancel the tab context (closing the tab) if the passed context is canceled. context.AfterFunc(ctx, tabCancel)