Skip to content

Commit 4553588

Browse files
authored
fix(core): Fix openBrowser AppleScript support for Arc (#11603)
1 parent 6efe49a commit 4553588

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

packages/docusaurus/src/commands/utils/openBrowser/openBrowser.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ async function tryOpenWithAppleScript({
9595
);
9696
}
9797

98+
// Test this manually with:
99+
// osascript ./packages/docusaurus/src/commands/utils/openBrowser/openChrome.applescript "http://localhost:8080" "Google Chrome"
100+
// osascript ./packages/docusaurus/src/commands/utils/openBrowser/openChrome.applescript "http://localhost:8080" "Arc"
98101
async function tryBrowser(browserName: string): Promise<boolean> {
99102
try {
100103
// This command runs the openChrome.applescript (copied from CRA)

packages/docusaurus/src/commands/utils/openBrowser/openChrome.applescript

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ on run argv
1919
set theProgram to item 2 of argv
2020
end if
2121

22+
-- Arc: simple open + activate, no tab reuse
23+
-- See https://github.com/facebook/docusaurus/issues/11582
24+
if theProgram is "Arc" then
25+
tell application "Arc"
26+
activate
27+
open location theURL
28+
end tell
29+
return
30+
end if
31+
2232
using terms from application "Google Chrome"
2333
tell application theProgram
2434

0 commit comments

Comments
 (0)