Use the tab available to the context menu as the message target instead of querying for the active tab.