windows.onFocusChanged problems

48 views
Skip to first unread message

Liang Cui

unread,
Jan 10, 2026, 3:04:40 AM (yesterday) Jan 10
to Chromium Extensions
ENV:
- windows11 
- chrome version  143.0.7499.193 (previous versions also have these problems.)

Issue 1: windows.onFocusChanged not fired when switching focus between Chrome and other apps

  • Steps:

    1. Focus a Chrome window

    2. click Notepad (or any non-Chrome app)

    3. 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:

    1. Focus Main Profile   window

    2. 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.

Reply all
Reply to author
Forward
0 new messages