Issue 1: windows.onFocusChanged not fired when switching focus between Chrome and other apps
Steps:
Focus a Chrome window
click Notepad (or any non-Chrome app)
click back to Chrome
Expected:
Event fires with windowId = chrome.windows.WINDOW_ID_NONE (-1) when Chrome loses focus
Event fires with the focused Chrome windowId when Chrome regains focus
Actual:
No windows.onFocusChanged event fired in both directions (Chrome → Notepad, Notepad → Chrome)
Issue 2: wrong windowId when switching between different Chrome profiles
Setup: multiple Chrome profiles (main profile with google account logged in , and one temp profile B), each has its own Chrome window.
Steps:
Focus Main Profile window
Switch focus to Profile B window
Expected (in Main Profile extension context):
windows.onFocusChanged fires with windowId = -1 (Main Profile has no focused Chrome window)
Actual (only in packed/store-installed):
Event fires but windowId equals Profile B’s windowId, not -1
Control:
If the same extension is loaded as unpacked, Profile A receives windowId = -1 as expected.
Switching focus from Profile B → Profile A: event parameters are correct in both profiles.