Skip to content

Commit

Permalink
feat: function to check if the browser is still running
Browse files Browse the repository at this point in the history
  • Loading branch information
le0m committed Aug 27, 2024
1 parent 8b2b9d5 commit 429a6aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions print2pdf/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ func getPrintParams(data GetPDFParams) (page.PrintToPDFParams, error) {
return params, nil
}

// Check if the browser is still running.
func Running() bool {
return browserCtx != nil && browserCtx.Err() == nil
}

// Get a buffer of bytes representing a webpage in PDF format.
func GetPDFBuffer(ctx context.Context, data GetPDFParams, res *[]byte) error {
defer Elapsed("Total time to print PDF")()
Expand Down

0 comments on commit 429a6aa

Please sign in to comment.