Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mkdocs_exporter/formats/pdf/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def __init__(self, options: dict = {}):
self.playwright = None
self.lock = asyncio.Lock()
self.debug = options.get('debug', False)
self.channel = options.get('channel', '')
self.headless = options.get('headless', True)
self.timeout = options.get('timeout', 60_000)
self.args = self.args + options.get('args', [])
Expand All @@ -61,7 +62,7 @@ async def launch(self) -> Browser:
logger.info('[mkdocs-exporter.pdf] Launching browser...')

self.playwright = await async_playwright().start()
self.browser = await self.playwright.chromium.launch(headless=self.headless, args=self.args)
self.browser = await self.playwright.chromium.launch(headless=self.headless, args=self.args, channel=self.channel)
self.context = await self.browser.new_context()

self.context.on('console', self.log)
Expand Down
3 changes: 3 additions & 0 deletions mkdocs_exporter/formats/pdf/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ class BrowserConfig(BaseConfig):
debug = c.Type(bool, default=False)
"""Should console messages sent to the browser be logged?"""

channel = c.Choice(['', 'chrome', 'msedge', 'chrome-beta', 'msedge-beta', 'msedge-dev'], default='')
"""The browser channel to use. (https://playwright.dev/python/docs/browsers#google-chrome--microsoft-edge)"""

headless = c.Type(bool, default=True)
"""Should the browser start in headless mode?"""

Expand Down