Ignore DevTools and icognito in history
Some fixe and refactor
Avoided switch to handle actions, properly close popup and switch to window on openActiveTab()