Closed
Bug 1172871
Opened 9 years ago
Closed 8 years ago
Implement Service Worker Clients.OpenWindow() for FirefoxOS
Categories
(Core :: DOM: Service Workers, defect)
Core
DOM: Service Workers
Tracking
()
RESOLVED
WONTFIX
Tracking | Status | |
---|---|---|
firefox41 | --- | affected |
People
(Reporter: noemi, Unassigned)
References
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
Details | Diff | Splinter Review |
As raised in https://bugzilla.mozilla.org/show_bug.cgi?id=1130687#c36, we will need to deal with the different scenarios independently, so opening this bug to track FirefoxOS one.
Reporter | ||
Updated•9 years ago
|
Assignee: nobody → alberto.crespellperez
Status: NEW → ASSIGNED
Comment 1•9 years ago
|
||
Add the component in charge of open window
Reporter | ||
Updated•9 years ago
|
Blocks: nga-toolkit-service-workers
Reporter | ||
Updated•9 years ago
|
Target Milestone: --- → NGA S3 (26Jun)
Reporter | ||
Updated•9 years ago
|
Component: DOM → DOM: Service Workers
Comment 2•9 years ago
|
||
The patch sends a 'content-handler' async message to parent, which is processed to call view activity and open a new browser window.
The main problem is how to return the reference of the new window to gecko?
I tried to create a new activity with a return value to send back the window object of the 'AppWindow' created in system/js/browser.js but it is a XPCOM object that can not be serialized in the activity response (As it doesn't work I don't include the code in the WIP).
I also tried to send a mozChromeEvent from the component to gaia but it fails because SystemAppProxy._sendCustomEvent can't send the event as the frame is null. However, I am going to have the same problem to send back the window reference through the mozContentEvent.
Can you give some advice about how to proceed?
Attachment #8621461 -
Attachment is obsolete: true
Attachment #8623691 -
Flags: feedback?(fabrice)
Comment 3•9 years ago
|
||
Albert, looks at what we do for the mozbrowseropenwindow event from the mozbrowser api. That looks like a very similar use case.
Updated•9 years ago
|
Attachment #8623691 -
Flags: feedback?(fabrice)
Comment 4•9 years ago
|
||
(In reply to Fabrice Desré [:fabrice] from comment #3)
> Albert, looks at what we do for the mozbrowseropenwindow event from the
> mozbrowser api. That looks like a very similar use case.
I've look the mozbrowseropenwindow, it works and seems a better approach than using the activity.
However I see that when setting '_blank' name it reuses the browser and navigate to the new url instead of opening a new one. If I set another name it opens a new browser window in background. I guess I need to explore a bit more the event details to fix it, but the main problem is that I can't still get a reference to the new window as happens with the activity approach.
Flags: needinfo?(fabrice)
Updated•9 years ago
|
Target Milestone: NGA S3 (26Jun) → FxOS-S1 (26Jun)
Reporter | ||
Updated•9 years ago
|
Target Milestone: FxOS-S1 (26Jun) → ---
Comment 5•9 years ago
|
||
Albert, do we want to always open this window in the same process as the caller? I guess OpenWindow() is a sync call also?
Flags: needinfo?(fabrice)
Comment 6•9 years ago
|
||
(In reply to Fabrice Desré [:fabrice] from comment #5)
> Albert, do we want to always open this window in the same process as the
> caller? I guess OpenWindow() is a sync call also?
Yes, at least in desktop environment it is a requisite.
Currently is a sync call but talking with andreas we agree that I have to move to async, as I have to return a promise it won't be a problem.
Flags: needinfo?(fabrice)
Comment 7•9 years ago
|
||
Sorry Albert, I'm still struggling a bit with this one. Is that correct:
1- We load site http://example.com, in processA
2- example.com runs a service worker, worker.js
3- worker.js calls openWindow('page.html')
4- we need to return a promise that resolves to the new window, running it in the same processA.
If so, I don't think we have the pieces we need right now. We need the ContentChild to create a new TabChild/TabParent pair, load page.html in it, and somehow notify gaia's system app that we have a new window to deal with. That's... interesting!
Flags: needinfo?(fabrice)
Comment 8•9 years ago
|
||
(In reply to Fabrice Desré [:fabrice] from comment #7)
> Sorry Albert, I'm still struggling a bit with this one. Is that correct:
>
> 1- We load site http://example.com, in processA
> 2- example.com runs a service worker, worker.js
> 3- worker.js calls openWindow('page.html')
> 4- we need to return a promise that resolves to the new window, running it
> in the same processA.
>
> If so, I don't think we have the pieces we need right now. We need the
> ContentChild to create a new TabChild/TabParent pair, load page.html in it,
> and somehow notify gaia's system app that we have a new window to deal with.
> That's... interesting!
Yes you are right, the main problem is about opening a without a parent. Have a look to https://bugzilla.mozilla.org/show_bug.cgi?id=1130687#c51 guidelines for desktop.
Flags: needinfo?(fabrice)
Comment 9•9 years ago
|
||
Yep, you should sync up with Bill to come up with something that also works for b2g.
Flags: needinfo?(fabrice)
Comment 10•9 years ago
|
||
Releasing it, please ni me if you need some feedback.
Assignee: alberto.crespell → nobody
Status: ASSIGNED → NEW
Updated•9 years ago
|
Blocks: ServiceWorkers-B2G
Updated•9 years ago
|
Updated•8 years ago
|
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•