Skip to content

Commit

Permalink
Merge pull request #10172 from quarto-dev/mac-edge-browser
Browse files Browse the repository at this point in the history
puppeteer - look also for Microsoft Edge on MacOS in addition to Google Chrome
  • Loading branch information
cscheid authored Jul 1, 2024
2 parents 0aed909 + 7066ab4 commit 76ce02f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions news/changelog-1.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ All changes included in 1.6:
## `quarto inspect`

- ([#10188](https://github.com/quarto-dev/quarto-cli/issues/10188)): `quarto inspect` properly resolves includes across subdirectory boundaries.

## Other Fixes and Improvements

- ([#10162](https://github.com/quarto-dev/quarto-cli/issues/10162)): Use Edge on `macOS` as a Chromium browser when available.
13 changes: 8 additions & 5 deletions src/core/puppeteer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { readRegistryKey } from "./windows.ts";
import { which } from "./path.ts";
import { safeExistsSync, which } from "./path.ts";
import { error, info } from "../deno_ral/log.ts";
import { existsSync } from "fs/mod.ts";
import { UnreachableError } from "./lib/error.ts";
Expand Down Expand Up @@ -202,10 +202,13 @@ export async function withHeadlessBrowser<T>(
async function findChrome(): Promise<string | undefined> {
let path;
if (Deno.build.os === "darwin") {
path = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome";
if (!existsSync(path)) {
return undefined;
}
const programs = [
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",
];
return programs.find((p) => {
safeExistsSync(p);
});
} else if (Deno.build.os === "windows") {
// Try the HKLM key
const programs = ["chrome.exe", "msedge.exe"];
Expand Down

0 comments on commit 76ce02f

Please sign in to comment.