Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

Closing character sheet creates history item in browser

1780358538
Lithl
Pro
Sheet Author
API Scripter
Browser: Chrome version 148.0.7778.217 Operating system: Windows 10 build 19045.6466 Character sheet: D&D 5e 2014 (may affect other sheets as well, since it seems to be an issue with the character sheet dialog, not the sheet itself, but I have not tried other sheets at the moment) Issue:  When I open a character from the journal, then later close the character, a history item is generated in the browser. The Back button thus doesn't return me to the game launch page. With a single character this isn't too much of an issue; just hit Back twice. But today I was doing a bunch of editing on monsters in my campaign, and by the time I was done, the history had filled up such that I couldn't  use Back to return to the campaign launch page. Going back the maximum amount allowed by the browser was still on the tabletop page. Minimizing the character sheet does not cause this problem, only closing it. Handouts and the edit token dialogue also do not cause this problem, only characters. Workaround: The Exit Game button on the settings page works properly to leave the tabletop page. The "goodbye" page it drops you on isn't the game launch page, but it does have a link to the launch page.
1780366094
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Lithl! I am confused by this. When you open a character sheet, are you actually losing the game page? Sheets should open in either an engaged window (unseen by the browser as an item), or in a separate window. I can see the separate window does seem to make a history item, but Back would not take you to the game, not being in the same window. I can't replicate what you are seeing with this description. Do you have your game set to open journals in a separate window? This can be turned off in the settings tab. Do you perhaps have an extension installed on your browser that modifies history behavior?
1780375243
Lithl
Pro
Sheet Author
API Scripter
When you open a character sheet, are you actually losing the game page? No. Start on /campaigns/details/$id/$name Click Launch Game to visit /editor Back button will take you to /campaigns/details/$id/$name  -- normal, expected behavior Open a character sheet. Close the character sheet. Browser history now has /editor as the previous page (which is also the current page), and is what the Back button will take you to, and /campaigns/details/$id/$name as the page before that. Open a character sheet. Close the character sheet. Browser history now has /editor as the previous two pages (which is still  the current page), and /campaigns/details/$id/$name as the page before that. Repeat ad infinitum. Do you have your game set to open journals in a separate window? No, this is all within the same window. Do you perhaps have an extension installed on your browser that modifies history behavior? No. Just to be certain, I just replicated the behavior in an incognito tab. Here's the back button after: Open new incognito tab Log in to Roll20 Navigate to campaign details page (4th item in the list above, "Skull & Shackles | Roll20: Online virtual tabletop") Open and close character sheets 3 times (each time a sheet is closed, a new "Skull & Shackles | Roll20" item gets created) In creating this screenshot, I never actually left /editor , nor reloaded the page, which suggests that history.pushState is getting called. ( pushState lets a developer artificially add items to the history despite not actually leaving the page, so that content can be loaded asynchronously and the forward/back buttons can still fulfil their intended function, like navigating a paginated list without leaving the page, and hitting Back to return to an earlier point in the list instead of a different webpage.)
1780376537
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks for the detailed steps. I can see what you describe now, and can confirm this is the behavior. I'm not sure why it's an issue, unless your intent is to use the back button to go to the home page. I've always used what you describe as a workaround, since the recommended way to leave a game is to use one of the two exit buttons which take you to the exit pages. Many people just close the browser window to exit, but this can result in people still looking like they are logged in. I can pass this on to the dev team and see if they can provide an explanation for the behavior, but I suspect it has not been an issue for anyone to this point (I've never seen anyone bring this up in over a decade of chasing reports). It might help my report if you can explain what this is keeping you from doing (I.e., why it's a pain point).
1780409309
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The answer I got was basically that they recognize the phenomenon but classify it as more an annoyance than an issue. The sheet dialogs open an iframe set to the sheet. When closing the dialog they set the iframe to a blank page, to kill any background processes it's running. Since the main page and all child iframes share a history context, when they redirect an iframe to a blank page it adds a new entry to that shared history. Hence what you are reporting.
1780440905
Lithl
Pro
Sheet Author
API Scripter
I've never seen anyone bring this up in over a decade of chasing reports Well that's not surprising, since I believe this is a new issue within the past few months.  From your description of the response you got, perhaps it was a consequence of the recent efforts to combat memory leaks caused by character sheets. I've always used what you describe as a workaround, since the recommended way to leave a game is to use one of the two exit buttons which take you to the exit pages. Many people just close the browser window to exit, but this can result in people still looking like they are logged in. With no exaggeration, I have used the Back button to leave the VTT every single time I've used it (until testing the Exit Game button yesterday to make sure it was a functional workaround), and I joined Roll20 only a few months after you did. I generally leave the browser tab on the campaign details page, or else take the opportunity to switch to the campaign details page of the next game I'll be playing, so I'm ready when the game is. Needing to hit Back multiple times is only something I've noticed recently. It wasn't until yesterday when I was doing work on monsters and closed enough sheets within a single game session that I completely filled up the history and couldn't go back any more that I bothered to track down the cause (leading to this post). If this phantom history item is being generated by setting an iframe's src attribute, then I think the solution ought to be easy: setting iframe src is only supposed to add to the history if the iframe is sitting in the DOM at the time of the change. If the iframe is removed from the DOM (via Element.remove method) before the src is changed, then no new history item should be created. If the iframes are getting reused (to avoid generating and deleting iframes over and over), it should be fine to then re-add it to the DOM after the src has been changed.