background.js: Registering windows event in a better place.