Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome shouldn't be closed when using Chrome service #58

Closed
brusch opened this issue Jan 19, 2024 · 1 comment
Closed

Chrome shouldn't be closed when using Chrome service #58

brusch opened this issue Jan 19, 2024 · 1 comment

Comments

@brusch
Copy link
Member

brusch commented Jan 19, 2024

Currently the browser gets closed after rendering here:
https://github.com/pimcore/web-to-print-bundle/blob/1.x/src/Processor/Chromium.php#L139

Actually this causes issues when using Chrome as as a container service, e.g. ws://chrome:3000/

The following patch fixes the issue:

diff --git a/src/Processor/Chromium.php b/src/Processor/Chromium.php
index dafc77c..4d1b25a 100644
--- a/src/Processor/Chromium.php
+++ b/src/Processor/Chromium.php
@@ -136,7 +136,7 @@ class Chromium extends Processor
             Logger::debug('Could not create pdf with chromium: '. print_r($e, true));
             $output = (string) $e;
         } finally {
-            $browser->close();
+            $page->close();
         }

         return $output;

Credits: @vrobert78 many thanks 👍😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants