Skip to content

Commit 76ce02f

Browse files
authored
Merge pull request #10172 from quarto-dev/mac-edge-browser
puppeteer - look also for Microsoft Edge on MacOS in addition to Google Chrome
2 parents 0aed909 + 7066ab4 commit 76ce02f

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

news/changelog-1.6.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ All changes included in 1.6:
33
## `quarto inspect`
44

55
- ([#10188](https://github.com/quarto-dev/quarto-cli/issues/10188)): `quarto inspect` properly resolves includes across subdirectory boundaries.
6+
7+
## Other Fixes and Improvements
8+
9+
- ([#10162](https://github.com/quarto-dev/quarto-cli/issues/10162)): Use Edge on `macOS` as a Chromium browser when available.

src/core/puppeteer.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
import { readRegistryKey } from "./windows.ts";
8-
import { which } from "./path.ts";
8+
import { safeExistsSync, which } from "./path.ts";
99
import { error, info } from "../deno_ral/log.ts";
1010
import { existsSync } from "fs/mod.ts";
1111
import { UnreachableError } from "./lib/error.ts";
@@ -202,10 +202,13 @@ export async function withHeadlessBrowser<T>(
202202
async function findChrome(): Promise<string | undefined> {
203203
let path;
204204
if (Deno.build.os === "darwin") {
205-
path = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome";
206-
if (!existsSync(path)) {
207-
return undefined;
208-
}
205+
const programs = [
206+
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
207+
"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",
208+
];
209+
return programs.find((p) => {
210+
safeExistsSync(p);
211+
});
209212
} else if (Deno.build.os === "windows") {
210213
// Try the HKLM key
211214
const programs = ["chrome.exe", "msedge.exe"];

0 commit comments

Comments
 (0)