Closed Bug 1261963 Opened 8 years ago Closed 7 years ago

createData should be optional for browser.windows.create

Categories

(WebExtensions :: Frontend, defect, P3)

defect

Tracking

(firefox-esr52 fixed, firefox55 fixed)

RESOLVED FIXED
mozilla55
Iteration:
48.3 - Apr 25
Tracking Status
firefox-esr52 --- fixed
firefox55 --- fixed

People

(Reporter: bsilverberg, Assigned: bsilverberg)

References

(Blocks 1 open bug)

Details

(Whiteboard: [windows]triaged)

Attachments

(2 files)

According to the docs [1][2] and also according to Chrome's behaviour, `createData` should be optional when calling `browser.windows.create.

This requires a change to the schema [3] and a test should probably be added to verify this change.

[1] https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/windows/create
[2] https://developer.chrome.com/extensions/windows#method-create
[3] https://dxr.mozilla.org/mozilla-central/source/browser/components/extensions/schemas/windows.json#284
Whiteboard: [good first bug]
I'm not sure that this should be a blocker, but on the other hand it's pretty simple and ideally we wouldn't have to introduce changes to a schema post 1.0.
Assignee: nobody → bob.silverberg
Status: NEW → ASSIGNED
Iteration: --- → 48.3 - Apr 18
Flags: blocking-webextensions?(amckay)
Flags: blocking-webextensions?(amckay) → blocking-webextensions+
Without bug 1262250 this becomes extra work, and this isn't critical, so I'm marking it as blocked.
Depends on: 1262250
Andy suggested I not work on bug 1262250, so I'm going to see what I can do to make this work without schema changes.
Comment on attachment 8739100 [details]
Bug 1261963 - createData should be optional for browser.windows.create,

https://reviewboard.mozilla.org/r/45043/#review41589

I'd rather handle this with bug 1262250.
Attachment #8739100 - Flags: review?(kmaglione+bmo)
Whiteboard: [good first bug] → [windows][good first bug]triaged
Should this buf (In reply to Kris Maglione [:kmag] from comment #5)
> Comment on attachment 8739100 [details]
> MozReview Request: Bug 1261963 - createData should be optional for
> browser.windows.create, r?kmag
> 
> https://reviewboard.mozilla.org/r/45043/#review41589
> 
> I'd rather handle this with bug 1262250.

Should this bug be closed then?
Flags: needinfo?(kmaglione+bmo)
No, it's still a bug.
Flags: needinfo?(kmaglione+bmo)
Keywords: good-first-bug
Whiteboard: [windows][good first bug]triaged → [windows]triaged
Comment on attachment 8739100 [details]
Bug 1261963 - createData should be optional for browser.windows.create,

https://reviewboard.mozilla.org/r/45043/#review79170

::: browser/components/extensions/test/browser/browser_ext_windows_create.js:26
(Diff revision 2)
>            browser.test.sendMessage("check-window", expected);
>          });
>        }
>  
>        function createWindow(params, expected, keep = false) {
>          return browser.windows.create(params).then(window => {

I'd like to see this actually call window.create() with no args (rather than with an arg of null).  I think the simplest way to do that is to make params an array and use the spread operator here.
Comment on attachment 8739100 [details]
Bug 1261963 - createData should be optional for browser.windows.create,

https://reviewboard.mozilla.org/r/45043/#review82310
Attachment #8739100 - Flags: review?(aswan) → review+
Component: WebExtensions: Untriaged → WebExtensions: Frontend
Flags: blocking-webextensions+
Priority: -- → P3
Keywords: good-first-bug
webextensions: --- → ?
webextensions: ? → ---
I finally figured out why this test was failing on try on Windows. On Windows, the test was starting with the browser window maximized, and creating a window via browser.windows.create() (on Windows anyway) creates a maximized window if the current window is maximized. The test expects the window created to be normal, not maximized, so I simply changed the test to update the current window to state: "normal" at the beginning of the test and that seems to have solved the issue.
Pushed by bsilverberg@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bb6c0cdfbea7
createData should be optional for browser.windows.create, r=aswan
https://hg.mozilla.org/mozilla-central/rev/bb6c0cdfbea7
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Blocks: 1422589
[Approval Request Comment]
If this is not a sec:{high,crit} bug, please state case for ESR consideration: This is a very simple fix that will enhance the browser.windows.create API. 
User impact if declined: Web extensions will not be able to call browser.windows.create with zero arguments.
Fix Landed on Version: 55
Risk to taking this patch (and alternatives if risky): This is a one-line change to a json schema file, and is covered by an automated test, so risk is extremely low. A try run has been started at https://treeherder.mozilla.org/#/jobs?repo=try&revision=e8fdcc3cb9e3f3c2985849e071ff5a335609964d.
String or UUID changes made by this patch: none

See https://wiki.mozilla.org/Release_Management/ESR_Landing_Process for more info.
Attachment #8934203 - Flags: approval-mozilla-esr52?
Comment on attachment 8934203 [details] [diff] [review]
Patch for uplift to ESR.

Low risk fix, with automated tests, got a second opinion from Andy, ESR52+
Attachment #8934203 - Flags: approval-mozilla-esr52? → approval-mozilla-esr52+
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: