Fix "current window" support

RESOLVED FIXED in Firefox 44

Status

()

Toolkit
WebExtensions: Untriaged
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: billm, Assigned: billm)

Tracking

unspecified
mozilla44
Points:
---

Firefox Tracking Flags

(firefox44 fixed)

Details

Attachments

(1 attachment)

The meaning of the current window in a WebExtension is a bit complex:
https://developer.chrome.com/extensions/windows#current-window
Created attachment 8657912 [details] [diff] [review]
patch

We had some support for "current window", but it was totally broken. This patch fixes it. The current window is tracked for "tab" and "popup" views. For "background" views, it's just whichever window happens to be frontmost.

I also fixed a few places where we iterate over all open windows but don't check that |window.document.readyState == "complete"|, which is necessary to avoid cases where gBrowser doesn't exist yet or something.
Attachment #8657912 - Flags: review?(gkrizsanits)
Attachment #8657912 - Flags: review?(gkrizsanits) → review+
Backed out the whole push in https://hg.mozilla.org/integration/mozilla-inbound/rev/f2e83a8b6b8e since it was intertangled and I wasn't entirely sure which part caused Mulet mochitest-5 to become permaorange with https://treeherder.mozilla.org/logviewer.html#?job_id=14545777&repo=mozilla-inbound
https://hg.mozilla.org/mozilla-central/rev/449065a3fbbd
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox44: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.