Fix openBrowser AppleScript support for Arc

This commit is contained in:
sebastien 2025-12-05 16:28:55 +01:00
parent 6efe49abaf
commit bdb5008c47
2 changed files with 13 additions and 0 deletions

View File

@ -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<boolean> {
try {
// This command runs the openChrome.applescript (copied from CRA)

View File

@ -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