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

Enhancement: do not incapacitate browser back button #69

Closed
webketje opened this issue Apr 27, 2023 · 3 comments · Fixed by #70
Closed

Enhancement: do not incapacitate browser back button #69

webketje opened this issue Apr 27, 2023 · 3 comments · Fixed by #70
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@webketje
Copy link
Contributor

Information

The glob-tool kind of abuses the browser history API. I suspect too many pushState calls (perhaps through a library like vue-router or caused by sync'ing the example options & input to the URL). As soon as one nagivates to https://do.co/glob-tool or the full URL https://www.digitalocean.com/community/tools/glob the browser back button is severely incapacitated as 8 history entries are added.

Details

Steps to reproduce

Navigate to do.co/glob-tool or the full URL in any browser, then long-press the browser back button (in Firefox and Chromium this displays a list of the previous history entries).

Expected behavior

At most 1 or 2 history entries should be added. Perhaps possible to use history.replaceState

@MattIPv4
Copy link
Contributor

👀 Would appear to be a bug, I don't recall it doing that historically (it used to just push a single entry iirc for the default values).

That being said, also agree it should probably be using replaceState instead. Switching to that "fixes" this, but would be great to solve for why it writes 8 times on first load in the first place.

@MattIPv4 MattIPv4 added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Apr 27, 2023
@webketje
Copy link
Contributor Author

webketje commented May 2, 2023

Another idea is to only read from the URL on initial load, and combined with #9 instead provide a share button with an input box and copy button with the live updated share URL (a bit similar to how Youtube video share button works)..
If this is added sync'ing to the url bar for easy copying becomes obsolete.

@MattIPv4
Copy link
Contributor

MattIPv4 commented May 2, 2023

I would probably still want to write to the URL even if the share button was implemented, as it not only allows someone to just copy the URL to share, but also acts as a great way to implicitly save state (rather than writing to localstorage etc.). We follow a similar pattern for our NGINXConfig tool, and in a way with our DNS/SPF tools (they write the domain to the URL).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants