Overhauled the chrome extension popup/background socket logic