When I inspect the page, the Network tab is showing 404 errors when trying to access the service.php page:
Web services and mobile are enabled under Site Administration. I tried enabling Access-Control-Allow-Origin "*" in apache and still get a popup but with the error message "Web service is not available (it doesn't exist or might be disabled)" From looking in the console, it looks to be trying to access core_message_get_unread_conversations_count.
Does something else need to be done so that these web services work when using https?
I ended up disabling both web services and the messaging system under System Administration - Advanced Features, as we are not using them, and the undefined pop-ups disappeared. It's a band-aid to the CORS issue but works for us since we're not using those two items and gets rid of the annoying pop-ups.