Or maybe the question should be slightly different since I know how to register custom protocol with xdg-mime. However in the man for xdg-mime there’s such passage:
application must already be installed in the desktop menu
before it can be made the default handler.
So how does one install AppImage in the desktop menu? Simply dragging and droping it on a toolbar doesn’t seem to work. I assume here that registering it in the “desktop menu” should suffice to make it handle custom protocols. Also xdg-mime process is probably specific to Ubuntu. Would be great to know to to make it work in general on all linux platforms.