Skip to content

Use Microsoft Edge for rendering (on Windows) #972

@eitsupi

Description

@eitsupi

Currently it seems that Chrome is required to render files that contain mermaid.
I think it is guaranteed that Windows has Microsoft Edge installed, so it would be useful to be able to use Microsoft Edge instead of Chrome.

async function findChrome(): Promise<string | undefined> {
let path;
if (Deno.build.os === "darwin") {
path = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome";
} else if (Deno.build.os === "linux") {
path = await which("google-chrome");
if (!path) {
path = await which("chromium-browser");
}
} else if (Deno.build.os === "windows") {
// Try the HKLM key
path = await readRegistryKey(
"HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\chrome.exe",
"(Default)",
);
// Try the HKCR key
if (!path) {
path = await readRegistryKey(
"HKCR\\ChromeHTML\\shell\\open\\command",
"(Default)",
);
}
}
return path;
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions