Closed Bug 1433358 Opened 8 years ago Closed 6 years ago

AppleEvents are not properly processed on cold start

Categories

(Core :: Widget: Cocoa, defect, P3)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: st3fan, Unassigned)

Details

Steps to reproduce: - Make sure Firefox is your default browser - Make sure Firefox is not running - From a shell: open http://www.mozilla.org Expected: Firefox starts and opens www.mozilla.org Actual: Firefox starts and opens a blank window
Priority: -- → P3
I narrowed this down to ProcessPendingGetURLAppleEvents() in MacAppDelegate. That function is run at application startup before we Apple Events are actually processed. It swallows all events. It is unclear why this is needed. I think this is a workaround for either an older macOS SDK or an older macOS version. When I remove the code from this function, things almost work as expected: Firefox properly gets the GetURL AppleEvent and opens a new window where the page is loaded. However, it also opens a new blank window, which can probaby be prevented by keeping track of the fact that we already opened one.
Any patch here will need to be tested against opening links from other applications, such as Thunderbird.
I think opening links from other pages, which is probably done through NSWorkspace#openURL, should effectively be the same as `open $URL` from the command line. It will trigger the GetURL AppleEvent.
Just confirming the previous comment: You can replace step 3 from the STR (From a shell: open http://www.mozilla.org) with "Open a link from another app" and the same thing happens. I don't have thunderbird, but I tried with Mail.app and Maps.app: Firefox starts but won't open the URL. If Firefox is already open, things work fine.
There seems to be more to this. A fresh profile with Firefox 58.0 properly opens the clicked link in Thunderbird with no additional tab. Do you have "restore tabs from last session" selected, or any similar pref?
Flags: needinfo?(sarentz)

This works now! The STR that I posted not works.

Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(sarentz)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.