Manifest: support "Continue where you left off" and "Open a specific page or set of pages"

Created on 16 Sep 2019  路  4Comments  路  Source: w3c/manifest

Previous Work

I really like how I can configure Google Chrome to "Continue where you left off" in chrome://settings/ in the "On startup" section. There is also an option to "Open a specific page or set of pages" which I know some people use.

Feature Request

I would like to see something similar for PWAs. i.e. I would like a way as a PWA publisher to advise the web browser running my application to reopen previously opened windows when the user reopens the application after previously closing/quitting it (e.g. Command + Q on macOS). This way several windows can be open in my PWA, each with possibly unique URLs, and when the user reopens the application they get those same windows back.

Examples

One way to support this would be to, in addition to the start_url property, support a start_urls property which can be set to "continue" to advise the browser to "Continue where you left off" or can be set to an array of urls to advise the browser to "Open a specific page or set of pages":

"Continue where you left off"

{
  "name": "Donate App",
  "description": "This app helps you donate to worthy causes.",
  "icons": [{
    "src": "images/icon.png",
    "sizes": "192x192"
  }],
  "start_url": "index.html",
  "start_urls": "continue"
}

"Open a specific page or set of pages"

{
  "name": "Donate App",
  "description": "This app helps you donate to worthy causes.",
  "icons": [{
    "src": "images/icon.png",
    "sizes": "192x192"
  }],
  "start_urls": ["find-your-cause.html", "manage-payment-options.html"]
}

Impact to the existing start_url property

  1. The existing start_url property would still behave the same for initial loading of the app as long as start_urls is not specified as an array of URLs.
  2. If both start_urls and start_url are specified then start_urls would take precedence.
  3. If start_urls is set to "continue" then a start_url can still be specified to be used in the initial launching of the PWA (although maybe this is not applicable as in order to install a PWA you must first open it in which case maybe it never makes sense to support providing both at the same time).
Feature Request

Most helpful comment

@mfulton26, are you comfortable closing this issue and leaving session restore as a browser-level feature rather than adding continuation URLs in the manifest spec?

All 4 comments

Ideally this kind of high level feature could be implemented with a combination of local storage, shared workers, launch events and window open APIs. We should flesh those areas out to ensure this is possible rather than add support for a specific use case to the manifest.

We actually had PWA session restore shipped in Chrome 76 on desktop (relaunch any open PWAs when you restarted your browser). However, we had to unship the feature because it had some bad side effects (removing all of your non-PWA session history in some cases). We're still committed to doing this, it's just more complicated than we initially thought. See https://crbug.com/938759.

More generally, we see this as a browser level feature controlled by users - it's unclear whether there's much more utility to be gained from allowing developers to specify continuation URLs over simply apply the existing session restore logic that takes the user straight back to where they were when they closed the browser.

@mfulton26, are you comfortable closing this issue and leaving session restore as a browser-level feature rather than adding continuation URLs in the manifest spec?

@dominickng yes, thank you.

Was this page helpful?
0 / 5 - 0 ratings