Closed Bug 1218289 Opened 9 years ago Closed 8 years ago

Export the second parameter of mozApps.install()

Categories

(Firefox OS Graveyard :: Gaia::TV, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(feature-b2g:2.6+)

RESOLVED WONTFIX
feature-b2g 2.6+

People

(Reporter: rickychien, Unassigned)

References

Details

According to bug 1211400, TV marketplace would decide to support both preview and install button on marketplace. 

Solution is going to make it possible to retrieve second parameter of mozApps.install(url, param) to inform system app which mode we want to use (preview / install)

For example, 

req = navigator.mozApps.install(url, { mode: 'preview' })

req.result.mode === 'preview'

so that system app will be able to catch result from that API call.

Fabrice, I think it needs to do some works at [1], do you have any opinion for that and maybe help me out here? thanks!

[1] https://dxr.mozilla.org/mozilla-central/source/dom/apps/Webapps.js#193
Flags: needinfo?(fabrice)
Ricky, who's calling mozApps.install() ? If it's already the system app, I don't think we need anything on the gecko side - the system app can keep track of what to preview itself.
If eg. the marketplace calls install() and we want to let the system app know that it's a different mode, they yes, we'll have to do something.
Flags: needinfo?(fabrice)
mozApps.install() will be called by marketplace or third-party website who wants to provide webapp installation. Therefore, the only way to inform system app will be through modifying mozApps.install().
Flags: needinfo?(fabrice)
Ok. So we can add { mode: 'preview' } to install() but setting it in req.result.mode will not help since only the marketplace will have access to req.result.
My proposal is to send this `mode` back to the system app in the webapps-ask-install event, coming from http://mxr.mozilla.org/mozilla-central/source/b2g/chrome/content/shell.js#1040
Flags: needinfo?(fabrice)
Cool! I'm fine with that.
Fabrice, another question is about the effort of patching Gecko. Does it will take lots of time for doing this?
Flags: needinfo?(fabrice)
Maybe I should ask more clearly :)  In your opinion, what's the ETA if we're going to do this? thanks!
(In reply to Ricky Chien [:rickychien] from comment #6)
> Maybe I should ask more clearly :)  In your opinion, what's the ETA if we're
> going to do this? thanks!

If I have to do it myself, I won't have time this week. But I'll be happy to mentor someone else!
Flags: needinfo?(fabrice)
Close this bug since we've decided to workaround this on gaia.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Leave this open because we still have to fix our system app workaround by this approach.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
feature-b2g: --- → 2.6+
I'm assuming that since bug 1211400 is fixed, that this is also fixed? If so, let's close this bug.
Flags: needinfo?(rchien)
(In reply to David Durst [:ddurst] from comment #10)
> I'm assuming that since bug 1211400 is fixed, that this is also fixed? If
> so, let's close this bug.

yes, we don't need this bug for now. close it.
Status: REOPENED → RESOLVED
Closed: 9 years ago8 years ago
Resolution: --- → WONTFIX
Flags: needinfo?(rchien)
You need to log in before you can comment on or make changes to this bug.