Clicking anywhere on the document may result in a message being send to background script, which could lead to an error being thrown if user is not logged in.
The click listener should check if the popup is even shown and return if it isn't shown or no selectText function is set.