Update popup.js

Updated script to reflect changes in HTML.
Improved listener for pop-up to content functionality.