From bdb5008c4770ff9f6e79788b43f06f733b6a02ca Mon Sep 17 00:00:00 2001 From: sebastien Date: Fri, 5 Dec 2025 16:28:55 +0100 Subject: [PATCH] Fix openBrowser AppleScript support for Arc --- .../src/commands/utils/openBrowser/openBrowser.ts | 3 +++ .../commands/utils/openBrowser/openChrome.applescript | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/packages/docusaurus/src/commands/utils/openBrowser/openBrowser.ts b/packages/docusaurus/src/commands/utils/openBrowser/openBrowser.ts index 2c4d2789a6..0660005a73 100644 --- a/packages/docusaurus/src/commands/utils/openBrowser/openBrowser.ts +++ b/packages/docusaurus/src/commands/utils/openBrowser/openBrowser.ts @@ -95,6 +95,9 @@ async function tryOpenWithAppleScript({ ); } + // Test this manually with: + // osascript ./packages/docusaurus/src/commands/utils/openBrowser/openChrome.applescript "http://localhost:8080" "Google Chrome" + // osascript ./packages/docusaurus/src/commands/utils/openBrowser/openChrome.applescript "http://localhost:8080" "Arc" async function tryBrowser(browserName: string): Promise { try { // This command runs the openChrome.applescript (copied from CRA) diff --git a/packages/docusaurus/src/commands/utils/openBrowser/openChrome.applescript b/packages/docusaurus/src/commands/utils/openBrowser/openChrome.applescript index c1efba1598..6d8e9a85ef 100644 --- a/packages/docusaurus/src/commands/utils/openBrowser/openChrome.applescript +++ b/packages/docusaurus/src/commands/utils/openBrowser/openChrome.applescript @@ -19,6 +19,16 @@ on run argv set theProgram to item 2 of argv end if + -- Arc: simple open + activate, no tab reuse + -- See https://github.com/facebook/docusaurus/issues/11582 + if theProgram is "Arc" then + tell application "Arc" + activate + open location theURL + end tell + return + end if + using terms from application "Google Chrome" tell application theProgram