Since the hook approach interferes with main menu event logging we should build the menu similar to how we add the nearby link if and only if available.
https://gerrit.wikimedia.org/r/197998 does this for Gather
A separate patch would be needed for Wikigrok
This way Gather and other extensions do not need to know anything about how MobileFrontend works and the main menu does not have to become a dumping ground.