Closed Bug 1516655 Opened 5 years ago Closed 5 years ago

browserAction forWindow checks

Categories

(WebExtensions :: General, enhancement, P2)

enhancement

Tracking

(firefox66 fixed)

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: mixedpuppy, Assigned: mixedpuppy)

References

Details

Attachments

(1 file)

While working on incognito support and fixing an issue in CUI code, I noticed that we often have code in ext-browserAction that does something like:

let widget = widget.forWindow(window);
if (!widget) ...

The issue here is, forWindow[1] always returns a widgetWrapper instance which contains the node if one exists[2].  I believe the checks should be:

if (!widget.node) ...

We should review our use of CUI and make sure we're handling this correctly.

[1] https://searchfox.org/mozilla-central/rev/8a135a9c5a96b59269f544fcaee76d8fd5a7026a/browser/components/customizableui/CustomizableUI.jsm#4014

[2] https://searchfox.org/mozilla-central/rev/8a135a9c5a96b59269f544fcaee76d8fd5a7026a/browser/components/customizableui/CustomizableUI.jsm#4067
Assignee: nobody → mixedpuppy
Priority: -- → P2
Blocks: 1511636
Pushed by scaraveo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bfd9ddf7b03b
fix widget.node checks in browserAction code, r=rpl
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66

Hi, will this bug require manual validation from the QA team? if so please specify how to correctly validate it, thanks!

Flags: needinfo?(mixedpuppy)

Existing tests should handle it just fine.

Flags: needinfo?(mixedpuppy) → qe-verify-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: