separate tab-side & popup-side javascript (and common)