Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to open app to previous state #462

Open
LSeelig opened this issue Feb 8, 2024 · 2 comments
Open

Add an option to open app to previous state #462

LSeelig opened this issue Feb 8, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@LSeelig
Copy link

LSeelig commented Feb 8, 2024

Problem Description

I created a PWA for a textbook for a course I am taking https://rust-book.cs.brown.edu/. One of the reasons I did this was because simply bookmarking it in my browser meant I had to hunt through history to return to the page I was on.

I thought able to restore the PWA to the previous session whenever I opened it would achieve this effect.

There are some issues with the Firefox feature that achieves this. From my testing, the problems occur because Firefox doesn't restore the old window in place of the new window, but instead opens the previously closed tabs and windows along with the new tab created by opening the app, and depending on how I have set tabs and windows to open, this leads to failing to launch the PWA, multiple tabs glitching into one window (without tab mode), or multiple windows opening.

Changing the homepage didn't work because it seems to be overridden by firefoxpwa, which always launches the app's home page as specified in settings/manifest.

Proposed Solution

There should be a FirefoxPWA about:config/settings page option to open to the previous session instead of the app's specified homepage. This should restore the previous session's windows. If that is unrealistic, it should just restore the last page to be closed in reverse order of history.

Additional Information

@LSeelig LSeelig added the enhancement New feature or request label Feb 8, 2024
@filips123
Copy link
Owner

From my testing, the problems occur because Firefox doesn't restore the old window in place of the new window, but instead opens the previously closed tabs and windows

Which option do you have set for the "When opening a link that should normally open in a new window or tab" preference in the PWA settings? Can you check if changing it to other options in the PWA settings fixes this issue?


Yeah, there are some problems with the session (re)store in PWAs, that's why it's disabled by default. Unfortunately, implementing full session support is quite hard, so it probably won't happen any time soon. This is tracked in issue #256.

But I will check if it's possible to at least add an option to open the last page URL when launching PWA.

@LSeelig
Copy link
Author

LSeelig commented Feb 18, 2024

Which option do you have set for the "When opening a link that should normally open in a new window or tab" preference in the PWA settings? Can you check if changing it to other options in the PWA settings fixes this issue?

It causes different behavior. Each behavior causes different restoring, though I am no longer sure if these launch failures are related to enabling firefox's session restores as I have observed it even when it is disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To Do
Development

No branches or pull requests

2 participants