Closed jrb-github closed 1 month ago
@jrb-github, I'm seeing the same problem. I originally thought the issue was limited to Chrome because Edge was still working. Since I created #159, Edge has updated and now taking a screenshot is not possible with either browser.
Is there a way to use Firefox instead of a Chromium based browser on Windows?
Is there a way to use Firefox instead of Chromium based browsers on Windows?
I'm pretty sure html2image only works with Chromium based browsers. If this issue doesn't get fixed soon, people relying on html2image might consider embedding an older version of Chromium into their app as discussed here:
https://medium.com/free-code-camp/the-python-desktop-application-3a66b4a128d3
IDK if that would work for sure, but it is the best idea I have ATM.
I'm pretty sure html2image only works with Chromium based browsers.
😞
If this issue doesn't get fixed soon, people relying on html2image might consider embedding an older version of Chromium into their app as discussed here:
https://medium.com/free-code-camp/the-python-desktop-application-3a66b4a128d3
IDK if that would work for sure, but it is the best idea I have ATM.
Thanks so much for the suggestion and for your quick reply. I'll take a look! 👀
I've just embedded a Google Chrome 127.0.6533.120 from portableapps so I didn't have to downgrade Google Chrome on my dev machine (Windows), and then did this:
hti = Html2Image(browser_executable = 'GoogleChromePortable/GoogleChromePortable.exe')
It's not the best solution (300MB+ size) but at the moment it works for me. I hope it helps! Thanks @git-n-pissed
I've just embedded a Google Chrome 127.0.6533.120 from portableapps so I didn't have to downgrade Google Chrome on my dev machine (Windows), and then did this:
hti = Html2Image(browser_executable = 'GoogleChromePortable/GoogleChromePortable.exe')
It's not the best solution (300MB+ size) but at the moment it works for me. I hope it helps! Thanks @git-n-pissed
Good to know that is a viable workaround. Thanks for commenting back.
A new version of html2image was released (v2.0.5), it should address this issue. Could you confirm that everything is working properly after updating the package? Thanks!
pip install --upgrade html2image
A new version of html2image was released (v2.0.5), it should address this issue. Could you confirm that everything is working properly after updating the package? Thanks!
pip install --upgrade html2image
Just updated and that seems to have fixed the issue. Thanks for the quick turn around on this @vgalin!
Do you know of any other breaking changes in the pipeline for Chromium? Just weighing the pros/cons of embedding a known compatible version of Chromium into my app.
2.0.5 works for me as well, thanks!
Do you know of any other breaking changes in the pipeline for Chromium? Just weighing the pros/cons of embedding a known compatible version of Chromium into my app. Your message is generally well-written, but here are some minor adjustments to improve clarity and flow:
@git-n-pissed I don't personally know of any, but on the other hand, I'm not actively following upcoming changes. This breaking change was a "huge" one, as they made the headless version closer (if not identical) to the non-headless version. However, it could have been non-breaking for html2image if they had kept the --headless
flag unchanged.
If your workflow relies heavily on html2image, keeping a portable version of Chromium might be the way to go.
Current (as of 2024-09-03) MS Edge versions fail on the screenshot method.
MS Edge 128.0.2739.54, if entering
edge://version
in the URL bar, reports it is Chromium 128.0.6613.114.Using the screenshot method with this EXE silently fails.
When trying to track down a close chromium version, I found 128.0.6613.0, and it yields this:
A Chromium version 127.0.x.x that I tried did not exhibit this behavior.
Similar behavior persists through last night's nightly Chromium build 130.0.6697.0.
Strangely, when not specifying the
browser_executable
path, I don't see these problems. Installed Chrome is 128.0.6613.120, where I would expect to see the issue.EDIT - I isolated this much further.
Using the binaries in this zip in this folder, the problem does not occur. With the binaries in this zip in this folder, it does. The problem was introduced on 2024-06-17, and just wasn't up-taken by MS Edge until last week or so.
Also, after the problem was introduced on 2024-06-17, both error lines shown above print, but the screenshot still generates in Chromium (though silently fails in MS Edge). Between then and 2024-09-03, only the first error line prints (Sandbox cannot access executable), then the screenshot method hangs.