Closed Bug 1457673 Opened 6 years ago Closed 6 years ago

Support WINDOW_ID_CURRENT in browser.windows.remove

Categories

(WebExtensions :: Frontend, defect)

61 Branch
defect
Not set
normal

Tracking

(firefox-esr52 unaffected, firefox-esr60 unaffected, firefox59 unaffected, firefox60 unaffected, firefox61 verified, firefox62 verified)

VERIFIED FIXED
mozilla61
Tracking Status
firefox-esr52 --- unaffected
firefox-esr60 --- unaffected
firefox59 --- unaffected
firefox60 --- unaffected
firefox61 --- verified
firefox62 --- verified

People

(Reporter: qw2g64, Assigned: Oriol)

References

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0
Build ID: 20180426220144

Steps to reproduce:

1. Open a new window
2. Debug an extension in about:debugging
3. Run:
    browser.windows.remove(browser.windows.WINDOW_ID_CURRENT)


Actual results:

Error: Type error for parameter windowId (Integer -2 is too small (must be at least 0)) for windows.remove.


Expected results:

The window is removed.

---

This is a regression in Firefox Nightly. The schema of this api set the minimum value of windowId to 0, but it was not enforced before the fix of Bug 1448120. Now it is enforced and WINDOW_ID_CURRENT(-2) is rejected. 

Suggested fix: change the minimum windowId to -2 like other windows apis.
Assignee: nobody → oriol-bugzilla
Blocks: 1448120
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Comment on attachment 8972445 [details]
Bug 1457673 - Support WINDOW_ID_CURRENT in browser.windows.remove

https://reviewboard.mozilla.org/r/241046/#review247046
Attachment #8972445 - Flags: review?(mixedpuppy) → review+
Keywords: checkin-needed
I'm landing on autoland.
Keywords: checkin-needed
Pushed by mixedpuppy@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/5ea81be0d028
Support WINDOW_ID_CURRENT in browser.windows.remove r=mixedpuppy
https://hg.mozilla.org/mozilla-central/rev/5ea81be0d028
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Verified as fixed in Firefox 61 and Firefox 62. The windows is removed without issues now.

I will attach a postfix video.
Status: RESOLVED → VERIFIED
Attached image Postfix video
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.