Summary
aMule should register itself as the OS-level handler for both the ed2k:// and magnet: URI schemes automatically, the same way auto-start was made cross-platform in #744 — with a toggle in Preferences and an option in the installer — instead of requiring users to edit the registry, LaunchServices, or .desktop/xdg-mime by hand.
Current state
The code already fully supports handling these links once they reach aMule:
CMagnetED2KConverter (src/MagnetURI.cpp) converts an eD2k-compatible magnet (xt=urn:ed2k:/urn:ed2khash: + xl=) into an ed2k:// link.
CamuleAppCommon::CheckPassedLink() and InitCommon() (src/amuleAppCommon.cpp) accept both ed2k:// and magnet: links passed on the command line and queue them via the ED2KLinks file.
- The standalone
ed2k tool (src/ED2KLinkParser.cpp) accepts magnet: and ed2k:// links.
amulecmd's Add command accepts both as well.
What is missing is the OS-level scheme registration:
- Linux:
org.amule.aMule.desktop declares only MimeType=x-scheme-handler/ed2k;. There is no x-scheme-handler/magnet, so magnet links from the browser never reach aMule. The ed2k association is also static (shipped in the .desktop); the user cannot toggle it.
- Windows:
packaging/windows/installer.nsi registers no URL protocol at all — neither ed2k nor magnet. Users must import a .reg file manually.
- macOS: there is no
Info.plist/CFBundleURLSchemes declaration; the OS only picks aMule up opportunistically through LaunchServices.
This is currently documented as a manual procedure on the website(User Manual → Utilities → ed2k → Browser Configuration). https://amule-org.github.io/docs/manual/utilities/ed2k
Requested change
Add automatic registration of the ed2k:// and magnet: schemes, implemented analogously to the auto-start feature from #744:
-
A cross-platform manager class (mirroring AutostartManager), with the OS being the source of truth:
- Windows:
HKCU\Software\Classes\<scheme> URL-protocol keys pointing at the aMule (or ed2k) binary — per-user, no elevation.
- Linux: register
x-scheme-handler/ed2k and x-scheme-handler/magnet (via .desktop MimeType= + the per-user
mimeapps.list/xdg-mime).
- macOS: declare both schemes in the app bundle's
Info.plist (CFBundleURLTypes) and/or register via LaunchServices.
Enable() / Disable() / IsEnabled() per scheme, idempotent, plus a SelfHeal-style fixup so a moved binary keeps working (same pattern as AutostartManager::SelfHealOnStartup()).
-
A Preferences toggle (same place/style as the auto-start checkbox in PrefsUnifiedDlg) to enable/disable the associations, with a one-shot command-line option to match --configure-autostart (e.g. --configure-protocols on|off).
-
An installer option (Windows NSIS Components page, analogous to the existing auto-start checkbox) that registers the schemes on install and cleans them up on uninstall.
Notes
- magnet handling must keep its existing eD2k-compatibility requirement (magnet must carry
xt=urn:ed2k:/urn:ed2khash: and xl=); BitTorrent-only magnets are out of scope.
- Once shipped, the manual browser-setup section in the docs should be reduced => https://amule-org.github.io/docs/manual/utilities/ed2k
Reference implementation to mirror: #744 (cross-platform auto-start).
Summary
aMule should register itself as the OS-level handler for both the
ed2k://andmagnet:URI schemes automatically, the same way auto-start was made cross-platform in #744 — with a toggle in Preferences and an option in the installer — instead of requiring users to edit the registry, LaunchServices, or.desktop/xdg-mimeby hand.Current state
The code already fully supports handling these links once they reach aMule:
CMagnetED2KConverter(src/MagnetURI.cpp) converts an eD2k-compatible magnet (xt=urn:ed2k:/urn:ed2khash:+xl=) into aned2k://link.CamuleAppCommon::CheckPassedLink()andInitCommon()(src/amuleAppCommon.cpp) accept bothed2k://andmagnet:links passed on the command line and queue them via theED2KLinksfile.ed2ktool (src/ED2KLinkParser.cpp) acceptsmagnet:anded2k://links.amulecmd'sAddcommand accepts both as well.What is missing is the OS-level scheme registration:
org.amule.aMule.desktopdeclares onlyMimeType=x-scheme-handler/ed2k;. There is nox-scheme-handler/magnet, so magnet links from the browser never reach aMule. The ed2k association is also static (shipped in the.desktop); the user cannot toggle it.packaging/windows/installer.nsiregisters no URL protocol at all — neithered2knormagnet. Users must import a.regfile manually.Info.plist/CFBundleURLSchemesdeclaration; the OS only picks aMule up opportunistically through LaunchServices.This is currently documented as a manual procedure on the website(User Manual → Utilities →
ed2k→ Browser Configuration). https://amule-org.github.io/docs/manual/utilities/ed2kRequested change
Add automatic registration of the
ed2k://andmagnet:schemes, implemented analogously to the auto-start feature from #744:A cross-platform manager class (mirroring
AutostartManager), with the OS being the source of truth:HKCU\Software\Classes\<scheme>URL-protocol keys pointing at the aMule (ored2k) binary — per-user, no elevation.x-scheme-handler/ed2kandx-scheme-handler/magnet(via.desktopMimeType=+ the per-usermimeapps.list/xdg-mime).Info.plist(CFBundleURLTypes) and/or register via LaunchServices.Enable()/Disable()/IsEnabled()per scheme, idempotent, plus aSelfHeal-style fixup so a moved binary keeps working (same pattern asAutostartManager::SelfHealOnStartup()).A Preferences toggle (same place/style as the auto-start checkbox in
PrefsUnifiedDlg) to enable/disable the associations, with a one-shot command-line option to match--configure-autostart(e.g.--configure-protocols on|off).An installer option (Windows NSIS Components page, analogous to the existing auto-start checkbox) that registers the schemes on install and cleans them up on uninstall.
Notes
xt=urn:ed2k:/urn:ed2khash:andxl=); BitTorrent-only magnets are out of scope.Reference implementation to mirror: #744 (cross-platform auto-start).