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

Fallback to Microsoft Edge if not installed Chrome #199

Closed
yhatt opened this issue Jan 17, 2020 · 6 comments · Fixed by #292
Closed

Fallback to Microsoft Edge if not installed Chrome #199

yhatt opened this issue Jan 17, 2020 · 6 comments · Fixed by #292
Labels
enhancement New feature or request

Comments

@yhatt
Copy link
Member

yhatt commented Jan 17, 2020

Microsoft has started rolling out new Edge browser based on Chromium. It will gradually be made available on Windows Update.

This fact is lucky for Marp CLI. PDF/PPTX conversion and preview mode has to install an extra Chrome/Chromium browser. Currently, it also works with Edge by setting CHROME_PATH environment variable.

It means the most of Windows 10 user will get the compatible browser without to do anything by user. If Marp CLI was supported fallback to Edge, installing extra browser won't be needed when converting Markdown into PDF/PPTX.

@yhatt yhatt added the enhancement New feature or request label Jan 17, 2020
@yhatt yhatt self-assigned this Jan 18, 2020
@ShGKme
Copy link

ShGKme commented Sep 1, 2020

Isn't it work of chrome-launcher package?

CLI just uses path from launcher:

;[executablePath] = Launcher.getInstallations()

@yhatt
Copy link
Member Author

yhatt commented Sep 1, 2020

@ShGKme chrome-launcher is only designed for Google Chrome and Chromium, not for Chromium-flavored browsers such as Edge.

@ShGKme
Copy link

ShGKme commented Sep 1, 2020

@yhatt But if CHROME_PATH is set to C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe, it works fine.

If it's not work for chrome-launcher, then maybe it's possible to add check to puppeteer.ts, that process.platform === 'win32' and msedge exists on usual paths.

I may do a PR if this solution is ok.

@yhatt yhatt removed their assignment Sep 1, 2020
@yhatt
Copy link
Member Author

yhatt commented Sep 1, 2020

In short term the limited fallback to Edge in Windows would be no problem. However, eventually we have to use (or create) Chromium Edge finder for Windows, macOS, and Linux as same as chrome-finder.ts in chrome-launcher.

@ShGKme
Copy link

ShGKme commented Sep 1, 2020

Edge is default only on Windows.

I thought, the idea was that windows users should be able to use already installed Edge without any actions as it is. Just because it works and the browser is already installed.

If any user has a normally installed Chrome, it would be found by chrome-launcher.
If user only has something unusual (like Brave or Edge on Mac), then user must provide the path. Same if user has browser installed to non-usual place.

Right now Edge has only 1 (ok, +1 more for Beta version) place to be installed by default in Windows (%programfiles%\Microsoft\Edge\Application\msedge.exe).

Of course, another way is to use some 3rd package, which would found any chromium-based browser on any OS. And add cli arg for choose like in Cypress.

@yhatt
Copy link
Member Author

yhatt commented Oct 6, 2020

Here is the one of reliable way to resolve the executable path of Edge, by Microsoft (microsoft/vscode-edge-devtools):
https://github.com/microsoft/vscode-edge-devtools/blob/5056752615b3f4332dc27242b008699075dcefce/src/utils.ts#L494-L524

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants