GeckoView: Web app manifest (PWAs)
Categories
(GeckoView :: General, enhancement, P1)
Tracking
(firefox-esr60 wontfix, firefox65 wontfix, firefox66 wontfix, firefox67 wontfix, firefox68 fixed)
People
(Reporter: sebastian, Assigned: snorp)
References
(Depends on 1 open bug, )
Details
(Keywords: perf-alert, Whiteboard: [geckoview:fenix:m3])
Attachments
(3 files)
Fenix: https://github.com/mozilla-mobile/fenix/issues/223
Android Components: https://github.com/mozilla-mobile/android-components/issues/1819
Fenix should get support for progressive web apps. One important piece of this is getting and using the Web App Manifest.
A simple approach may be to expose the URL of the manifest to the application. The app (or a component would be responsible for downloading and parsing the manifest).
A nicer approach would be to let Gecko(View) do the download and parsing and provide a rich manifest object to the application.
Assignee | ||
Comment 1•6 years ago
|
||
(In reply to Sebastian Kaspari (:sebastian) from comment #0)
Fenix: https://github.com/mozilla-mobile/fenix/issues/223
Android Components: https://github.com/mozilla-mobile/android-components/issues/1819Fenix should get support for progressive web apps. One important piece of this is getting and using the Web App Manifest.
A simple approach may be to expose the URL of the manifest to the application. The app (or a component would be responsible for downloading and parsing the manifest).
A nicer approach would be to let Gecko(View) do the download and parsing and provide a rich manifest object to the application.
One thing that may affect our approach here is how deep we would like the manifest integration to go. In Fennec, Gecko is mostly ignorant of manifest-related activity as the enforcement of the manifest (scope, etc) is applied outside of Gecko in the PWA shell. Maybe we would like to change that such that DocShell and friends are involved? This would probably make PWAs on Desktop easier to support if we can share a bunch of the implementation. We'd likely keep the UI stuff (icons) separate.
Andrew, is anyone on your team interested in Web App Manifest stuff from this perspective?
Comment 2•6 years ago
|
||
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) from comment #1)
(In reply to Sebastian Kaspari (:sebastian) from comment #0)
Fenix: https://github.com/mozilla-mobile/fenix/issues/223
Android Components: https://github.com/mozilla-mobile/android-components/issues/1819Fenix should get support for progressive web apps. One important piece of this is getting and using the Web App Manifest.
A simple approach may be to expose the URL of the manifest to the application. The app (or a component would be responsible for downloading and parsing the manifest).
A nicer approach would be to let Gecko(View) do the download and parsing and provide a rich manifest object to the application.
One thing that may affect our approach here is how deep we would like the manifest integration to go. In Fennec, Gecko is mostly ignorant of manifest-related activity as the enforcement of the manifest (scope, etc) is applied outside of Gecko in the PWA shell. Maybe we would like to change that such that DocShell and friends are involved? This would probably make PWAs on Desktop easier to support if we can share a bunch of the implementation. We'd likely keep the UI stuff (icons) separate.
Andrew, is anyone on your team interested in Web App Manifest stuff from this perspective?
I'm sure Marcos is but it's not something that's on our radar right now.
Reporter | ||
Comment 3•6 years ago
|
||
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) from comment #1)
One thing that may affect our approach here is how deep we would like the manifest integration to go. In Fennec, Gecko is mostly ignorant of manifest-related activity as the enforcement of the manifest (scope, etc) is applied outside of Gecko in the PWA shell.
Does this require Gecko(View) to know about the manifest or could this be something the app applies to the GeckoSession ("Use this scope and let me know if you leave it")?
Assignee | ||
Comment 4•6 years ago
|
||
(In reply to Sebastian Kaspari (:sebastian) from comment #3)
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) from comment #1)
One thing that may affect our approach here is how deep we would like the manifest integration to go. In Fennec, Gecko is mostly ignorant of manifest-related activity as the enforcement of the manifest (scope, etc) is applied outside of Gecko in the PWA shell.
Does this require Gecko(View) to know about the manifest or could this be something the app applies to the GeckoSession ("Use this scope and let me know if you leave it")?
Well the whole concept of "scope" is specific to the Web App Manifest spec. So I think it may be easier to tell a GeckoSession
to "use the manifest if you find one". What that means in practice is certainly up for debate, but for navigations that leave the defined scope we could consider adding stuff to onLoadRequest
or whatever.
Comment 5•6 years ago
|
||
[geckoview:fenix:p1] for now because figuring out our roadmap for PWA support in GV and Fenix is a Q1 OKR.
Updated•6 years ago
|
Comment 6•6 years ago
|
||
Tentatively tagging as [geckoview:fenix:m3] because PWA support is scheduled for Fenix M4. We still need to figure out what Fenix actually needs.
Reporter | ||
Comment 7•6 years ago
|
||
Here's the related AC meta:
https://github.com/mozilla-mobile/android-components/issues/1819
Assignee | ||
Comment 8•6 years ago
|
||
We discussed this a bit in triage. It sounds like short-term, we should just provide the parsed (and validated) manifest information to apps and go from there.
Assignee | ||
Updated•6 years ago
|
Comment 9•6 years ago
|
||
Fenix plans to work on PWA support in M4, so GV should provide APIs in M3.
Assignee | ||
Comment 10•6 years ago
|
||
This lets us request, e.g. '/assets/www/hello.html'.
Assignee | ||
Comment 11•6 years ago
|
||
This delivers a parsed and validated Web App Manifest to the
application, if present, during the page load process.
Depends on D22611
Assignee | ||
Comment 12•6 years ago
|
||
Sebastian, Christian, would you take a look at the API in the attached patch to make sure it seems reasonable for a-c? We're just firing onWebAppManifest(GeckoSession, JSONObject)
on every page load when a valid manifest is present.
Assignee | ||
Comment 13•6 years ago
|
||
Marcos, since this is in your wheelhouse, any comments are appreciated. Right now we're planning to defer most of the actual enforcement of the manifest to the app, since that seems to be the most expedient.
Reporter | ||
Comment 14•6 years ago
|
||
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) (he/him) from comment #12)
Sebastian, Christian, would you take a look at the API in the attached patch to make sure it seems reasonable for a-c? We're just firing
onWebAppManifest(GeckoSession, JSONObject)
on every page load when a valid manifest is present.
-
I am not super happy to have to deal with an (undocumented) JSONObject instead of a POJO (with clear documented values) - but it may work for now - and we have that in AC already anyways. :)
-
How do we deal with relative URLs - which are relative to the manifest URL (like
"start_url": "."
in your test code, or the icon and scope URLs)? Are they going to be translated to absolute URLs on your side (which would be great) or do we have to deal with that (which would be meh and we would need the manifest URL for that too). -
Color values (e.g. background_color, theme_color) can have CSS color names like "red", "aliceblue" (and I'm not sure what else is supported - the same as in CSS?) - Who is responsible for generating an actual color value from that? Is that easy for you to do? For us probably not. I haven't check how/if we deal with that in Fennec.
-
Is this a correct assumption: You will always provide us the manifest if it's in the currently displayed document. So if we observe a location change, we can assume the displayed page does not have a manifest - unless we get one from you again.
Assignee | ||
Comment 15•6 years ago
|
||
(In reply to Sebastian Kaspari (:sebastian; :pocmo) from comment #14)
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) (he/him) from comment #12)
Sebastian, Christian, would you take a look at the API in the attached patch to make sure it seems reasonable for a-c? We're just firing
onWebAppManifest(GeckoSession, JSONObject)
on every page load when a valid manifest is present.
- I am not super happy to have to deal with an (undocumented) JSONObject instead of a POJO (with clear documented values) - but it may work for now - and we have that in AC already anyways. :)
Yeah, I agree it's not ideal. The manifest is under continuous evolution, though, including experimental extensions that aren't in the spec at all. I want to allow us to take advantage of those things too. I guess we could have concrete getters for the common stuff (getName()
, etc), but allow raw key access as well?
- How do we deal with relative URLs - which are relative to the manifest URL (like
"start_url": "."
in your test code, or the icon and scope URLs)? Are they going to be translated to absolute URLs on your side (which would be great) or do we have to deal with that (which would be meh and we would need the manifest URL for that too).
I'll take a look. I know we are generating absolute URLs for the icons. It does seem like start_url
and maybe scope
should get the same treatment.
- Color values (e.g. background_color, theme_color) can have CSS color names like "red", "aliceblue" (and I'm not sure what else is supported - the same as in CSS?) - Who is responsible for generating an actual color value from that? Is that easy for you to do? For us probably not. I haven't check how/if we deal with that in Fennec.
We don't handle it at all in Fennec. I guess Gecko should be able to resolve those to rgb for you if you'd like.
- Is this a correct assumption: You will always provide us the manifest if it's in the currently displayed document. So if we observe a location change, we can assume the displayed page does not have a manifest - unless we get one from you again.
That's right.
Comment 16•6 years ago
|
||
Apologies for the delay... long weekend here in Australia.
(In reply to Sebastian Kaspari (:sebastian; :pocmo) from comment #14)
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) (he/him) from comment #12)
Sebastian, Christian, would you take a look at the API in the attached patch to make sure it seems reasonable for a-c? We're just firing
onWebAppManifest(GeckoSession, JSONObject)
on every page load when a valid manifest is present.
- How do we deal with relative URLs - which are relative to the manifest URL (like
"start_url": "."
in your test code, or the icon and scope URLs)? Are they going to be translated to absolute URLs on your side (which would be great) or do we have to deal with that (which would be meh and we would need the manifest URL for that too).
Can do that in the processed manifest for you.
- Color values (e.g. background_color, theme_color) can have CSS color names like "red", "aliceblue" (and I'm not sure what else is supported - the same as in CSS?) - Who is responsible for generating an actual color value from that?
Should be the manifest processor.
Is that easy for you to do? For us probably not. I haven't check how/if we deal with that in Fennec.
Happy to translate them to whatever you need. Hex values I guess?
- Is this a correct assumption: You will always provide us the manifest if it's in the currently displayed document. So if we observe a location change, we can assume the displayed page does not have a manifest - unless we get one from you again.
Good question: I think it should be that one is "applied" by user action, and that one applies all the navigations in scope (i.e., you shouldn't get an updated one as the user goes from one page to another).
Assignee | ||
Comment 17•6 years ago
|
||
(In reply to Marcos Caceres [:marcosc] from comment #16)
- Is this a correct assumption: You will always provide us the manifest if it's in the currently displayed document. So if we observe a location change, we can assume the displayed page does not have a manifest - unless we get one from you again.
Good question: I think it should be that one is "applied" by user action, and that one applies all the navigations in scope (i.e., you shouldn't get an updated one as the user goes from one page to another).
I think this would be nice, but it's problematic with the current plan being that we offload all enforcement of the manifest to the GeckoView-using app. If we took a more hands-on approach inside Gecko then this seems feasible. As it is, Gecko has no concept of a manifest being applied.
Assignee | ||
Comment 18•6 years ago
|
||
Depends on D22612
Assignee | ||
Comment 19•6 years ago
•
|
||
I modified the test to ensure relative "start_url" is resolved to an absolute one, and added a patch to convert named CSS colors (red, cadetblue, etc) into rgb.
Updated•6 years ago
|
Comment 20•6 years ago
|
||
Comment 21•6 years ago
|
||
Comment 22•6 years ago
|
||
Backed out 3 changesets (bug 1522451) for eslint failure
Log:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=233902487&repo=autoland&lineNumber=285
Push with failures:
https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=d291cd16ef76f783402a0ed079263e8335e94448
Backout:
https://hg.mozilla.org/integration/autoland/rev/0ffd90627891a67ff84c77480f84cd39db3c1b50
Comment 23•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Comment 24•6 years ago
|
||
Backed out for causing failures at dom/manifest/test/test_ManifestProcessor_background_color.html
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=233958153&repo=autoland&lineNumber=23885
Backout: https://hg.mozilla.org/integration/autoland/rev/0ec36abbdb31f9bf12867c6f066ac60ed2e1ba50
Assignee | ||
Updated•6 years ago
|
Comment 25•6 years ago
•
|
||
67=wontfix. PWA support has been deferred until after Fenix MVP so we won't need to uplift Web App Manifest support to GV 67 Beta.
Comment 26•6 years ago
|
||
Comment 27•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/14239118ee12
https://hg.mozilla.org/mozilla-central/rev/b0fae76a5641
https://hg.mozilla.org/mozilla-central/rev/910f28106bdc
Comment 28•6 years ago
|
||
Seems like this brought some very big perf improvements on Android! \0/
== Change summary for alert #20017 (as of Thu, 21 Mar 2019 01:12:35 GMT) ==
Improvements:
48% raptor-tp6m-ebay-kleinanzeigen-search-geckoview fcp android-hw-p2-8-0-android-aarch64 opt 1,186.75 -> 613.00
43% raptor-tp6m-web-de-geckoview fcp android-hw-p2-8-0-android-aarch64 opt 889.42 -> 509.08
43% raptor-tp6m-ebay-kleinanzeigen-search-geckoview android-hw-p2-8-0-android-aarch64 opt 1,985.74 -> 1,138.65
38% raptor-tp6m-web-de-geckoview android-hw-p2-8-0-android-aarch64 opt 1,363.69 -> 844.79
20% raptor-tp6m-ebay-kleinanzeigen-search-geckoview loadtime android-hw-p2-8-0-android-aarch64 opt 2,428.29 -> 1,933.79
For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=20017
Comment 29•6 years ago
|
||
(In reply to Ionuț Goldan [:igoldan], Performance Sheriffing from comment #28)
Seems like this brought some very big perf improvements on Android! \0/
This is very surprising. None of the changesets in the pushlog, including this bug, look like they would improve page load performance:
Maybe something changed in the tp6m tests? They appear to have not reported any results since Tuesday March 19:
Comment 30•6 years ago
|
||
(In reply to Chris Peterson [:cpeterson] from comment #29)
(In reply to Ionuț Goldan [:igoldan], Performance Sheriffing from comment #28)
Seems like this brought some very big perf improvements on Android! \0/
This is very surprising. None of the changesets in the pushlog, including this bug, look like they would improve page load performance:
Maybe something changed in the tp6m tests? They appear to have not reported any results since Tuesday March 19:
Robert, are you aware of any tp6m test changes?
Comment 31•6 years ago
|
||
(In reply to Ionuț Goldan [:igoldan], Performance Sheriffing from comment #30)
(In reply to Chris Peterson [:cpeterson] from comment #29)
Maybe something changed in the tp6m tests? They appear to have not reported any results since Tuesday March 19:
Robert, are you aware of any tp6m test changes?
No. Note that the link above is for tp6m wikipedia specifically which is having issues (Bug 1533059) hence why that test has no results since Mar 19.
Comment 32•6 years ago
|
||
Note that around that same time, the android-hw-g5-7-0-arm7-api-16
test platform was replaced by android-hw-g5-7-0-arm7-api-16-pgo
. So we need to compare old non-PGO name with the new PGO name to see PGO's perf improvement:
Comment 33•6 years ago
|
||
There is a issue with the toolchains that was apparently introduced here https://treeherder.mozilla.org/#/jobs?repo=autoland&searchStr=gradle-dependencies&revision=910f28106bdcc86e689bc2edbe795194c2a71293 but for some obscure reason, the test was not running for it in the last 9 days.
Wasn't able to backout because of a hunk failed:
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md
Here's a log of the failures:
https://treeherder.mozilla.org/logviewer.html#?job_id=236502887&repo=autoland
Comment 34•6 years ago
|
||
The list of files that trigger the gradle-dependencies job are:
- 'taskcluster/scripts/misc/tooltool-download.sh'
- 'taskcluster/scripts/misc/android-gradle-dependencies/**'
- '*.gradle'
- 'mobile/android/**/*.gradle'
- 'mobile/android/config/mozconfigs/android-api-16-gradle-dependencies/**'
- 'mobile/android/config/mozconfigs/common*'
- 'mobile/android/gradle.configure'
And sure enough, none of the changes in this bug touched any of those files. Which begs the question: should the list be extended?
Comment 35•6 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #34)
The list of files that trigger the gradle-dependencies job are:
- 'taskcluster/scripts/misc/tooltool-download.sh'
- 'taskcluster/scripts/misc/android-gradle-dependencies/**'
- '*.gradle'
- 'mobile/android/**/*.gradle'
- 'mobile/android/config/mozconfigs/android-api-16-gradle-dependencies/**'
- 'mobile/android/config/mozconfigs/common*'
- 'mobile/android/gradle.configure'
And sure enough, none of the changes in this bug touched any of those files. Which begs the question: should the list be extended?
I don't think so. All the changes in that sequence are to "Just Java and Kotlin", which can break the task (because the build steps break) but shouldn't re-fetch dependencies. This was a legitimately hard case: we changed some build-time functionality, which broke a scenario that was accidentally still exercised in the a-g-d task and no longer in the build. That's tough to avoid automatically.
Comment hidden (Intermittent Failures Robot) |
Assignee | ||
Updated•6 years ago
|
Updated•5 years ago
|
Description
•