Experiment: File conversions using Firefox through WebDriver BiDi
yhatt opened this issue · 0 comments
yhatt commented
Background
Mozilla and Google have announced that Puppeteer now supports WebDriver BiDi protocol. The headless Firefox could not generate PDF for a long time. But now, Firefox becomes able to generate PDF through WebDriver BiDi (Since Firefox 112: https://bugzil.la/1806810)
The support for other functions Marp CLI is depending is still in progress, but that is well worth to try to support PDF/PPTX/image conversion using Firefox.
Most Linux distributions have installed Firefox as a default browser. If implemented the auto-detection of Firefox binary path, Linux users may no longer have to worry about installed browsers. It's important because Marp ecosystem should be easy to touch for everyone.
Related pages
- https://hacks.mozilla.org/2023/12/puppeteer-webdriver-bidi/
- https://developer.chrome.com/blog/puppeteer-webdriver-bidi-2023
- https://pptr.dev/webdriver-bidi
Related issues
Concerns
- Currently Firefox does not support
Page.pdf({ preferCSSPageSize: true })
. Marp CLI conversion logic has to set the proper width and height instead of relying on Marpit'sprintable
option. - Firefox emits only PNG file even if used
page.screenshot
withtype
option as another file type.