On macOS, URLs provided via Apple Events (e.g. `open https://example.com`) can be lost on cold start, particularly when the profile manager dialog appears. This happens because InitializeMacApp() runs [NSApp run] briefly to collect URLs, but the Apple Event may arrive after the run loop exits. URLs arriving in this window were dispatched via nsICommandLineRunner which fails during early startup. Fix this by adding a new LaunchStatus::Running state. The openURLs: delegate now buffers URLs into StartupURLs() for all pre-Running states (not just CollectingURLs). The transition to Running happens after SetupMacCommandLine has consumed startup URLs via TakeStartupURLs(), ensuring late-arriving Apple Event URLs are captured and processed. Differential Revision: https://phabricator.services.mozilla.com/D298050
19 lines
642 B
C
19 lines
642 B
C
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
// This file defines the interface between Cocoa-specific Obj-C++ and generic
|
|
// C++, so it itself cannot have any Obj-C bits in it.
|
|
|
|
#ifndef MacApplicationDelegate_h_
|
|
#define MacApplicationDelegate_h_
|
|
|
|
void EnsureUseCocoaDockAPI(void);
|
|
void SetupMacApplicationDelegate(bool* gRestartedByOS);
|
|
void InitializeMacApp(void);
|
|
nsTArray<nsCString> TakeStartupURLs();
|
|
void StartupURLCollectionComplete(void);
|
|
void DisableAppNap(void);
|
|
|
|
#endif
|