Skip to content

Commit

Permalink
Merge pull request #13 from chialab/browser-context
Browse files Browse the repository at this point in the history
fix: create a separate browser context when printing a PDF
  • Loading branch information
le0m committed Sep 13, 2024
2 parents 147633e + 3dbaadb commit 1caff5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion print2pdf/print2pdf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1caff5d

Please sign in to comment.