background.js: Bug fix when switching window.