windows.onFocusChanged sometimes fires unexpectedly, without user action

RESOLVED INVALID

Status

()

Toolkit
WebExtensions: Untriaged
RESOLVED INVALID
7 months ago
7 months ago

People

(Reporter: pmorris, Unassigned)

Tracking

55 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 months ago
I've noticed that windows.onFocusChanged[0] can sometimes fire "in the background" without user action. After leaving my laptop alone for awhile I'll find window focus events have appeared in the logs. 

I've seen this happen in response to what looks like a push event from a server, related to the lastpass addon. (Maybe it opens some kind of 'window' in the background?)

I assumed it would only fire in response to a user navigating to a new url, but that doesn't seem to be the case?  Is this expected behavior?

I'm working on porting "Mind the Time"[1] to WebExtensions and have uploaded some beta releases.  The most recent has console logging to see when events like this fire.

This is on FF 55.0 dev edition, multi-process, on Ubuntu 16.04, with my own profile with many open tabs, other add-ons, and several windows open.

[0] https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/windows/onFocusChanged
[1] https://addons.mozilla.org/en-US/firefox/addon/mind-the-time/
There's no guarantee that any API events have any correlation to user actions, except the ones that explicitly say that they do. onFocusChanged fires whenever the focus changes, regardless of why it happened.
Status: NEW → RESOLVED
Last Resolved: 7 months ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.