Add browser options --browser
and several sub options
#603
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #565.
This PR introduces new options about browser:
--browser
,--browser-path
,--browser-protocol
, and--browser-timeout
.--browser
The
--browser
option specifies the kind of browser for conversion. If set comma-separated browsers, CLI will try to use the first available browser among them.The default value is
auto
, which meanschrome,edge,firefox
.--browser-path
The
--browser-path
option allows you to explicitly set the path to the browser executable.This is similar to setting the
CHROME_PATH
environment variable in v3 and earlier, but it can be used across all browsers. For backward compatibility,CHROME_PATH
is still supported when usingchrome
as the browser.--browser-protocol
The
--browser-protocol
option specifies the preferred protocol to use for browser connection.# Use WebDriver BiDi protocol in Chrome marp --browser chrome --browser-protocol webdriver-bidi ./slide.md
The preferred protocol may be ignored if the browser does not support it (e.g. Firefox is only supporting WebDriver BiDi). The default value is
cdp
(Chrome DevTools Protocol), that is same as up until now.--browser-timeout
The
--browser-timeout
option specifies the timeout for each browser operation in seconds. The default timeout is 30 seconds. If set--no-browser-timeout
or--browser-timeout=0
, the timeout will be disabled.Please note that this timeout is for each browser operation by specified protocol, not for the entire conversion process. For example, opening Marp HTML in browser internally and generating PDF from HTML are separate operations. So if you set
--browser-timeout 10
, the timeout of 10 seconds are applied to each operation.