blueboxd / chromium-legacy

Latest Chromium (≒Chrome Canary/Stable) for Mac OS X 10.7+

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Cannot drag links onto Chromium's icon

gpsvisualizer opened this issue · comments

If Chromium Legacy is NOT set as my default browser, and I try to drag a link from another browser (Chrome, Waterfox, or Firefox) onto Chromium Legacy's Dock icon, it does not open in Chromium; it opens in the default browser.

If Chromium Legacy IS set as my default browser, and I try to drag a link from another browser onto Chromium Legacy's Dock icon, it STILL does not open in Chromium Legacy; Chromium is brought to the front, but the link is not opened.

Mac OS version: Yosemite 10.10.5
Chromium version: 123.0.6303.0 (but the same problem occurs in v122 as well)

Can confirm this in Mavericks. Issue occurs starting in Chromium Legacy 121.

Can confirm on Lion, seems to be an issue with console arguments. I'm going to downgrade to 120.0.6099.199.1 until this is fixed; this breaks one of my other applications.

For reference, we ran into this bug before: #68

All the symptoms are the same. In addition to not being able to drag links into Chromium's icon, Chromium also cannot open links from other apps, or local .html or .webloc files.

This bug was previously fixed in a9efda1

It looks like the apple event handlers are once again missing from https://github.com/blueboxd/chromium-legacy/blob/master.lion/chrome/browser/app_controller_mac.mm, which is presumably causing the bug.

It looks like we just need to add three lines back to mainMenuCreated:

NSAppleEventManager* em = [NSAppleEventManager sharedAppleEventManager];
[em setEventHandler:self andSelector:@selector(getUrl:withReply:) forEventClass:kInternetEventClass andEventID:kAEGetURL];
[em setEventHandler:self andSelector:@selector(getUrl:withReply:) forEventClass:'WWW!' andEventID:'OURL'];

Adding these via code injection swizzling fixes the bug.

Note that the equivalent cleanup lines are already present in unregisterEventHandlers.

This bug is fixed in the most recent version of #25

This bug seems to have been fixed in v127.