staticrypt icon indicating copy to clipboard operation
staticrypt copied to clipboard

Browser Back Navigation Does Not Work

Open p0fi opened this issue 1 year ago • 6 comments

I'm trying to navigate back to a previous visited page using the browser back button.

What's happening

When I use the back button to come back to a previously visited page the page is blank. When I reload the page it gets decrypted and displayed correctly.

What should be happening

I expect the page to be shown as previously visited.

My setup

StatiCrypt version: npx staticrypt ... so I assume latest Node version: 18 Any additional relevant context, if any: –

p0fi avatar Feb 26 '24 14:02 p0fi

Thanks for opening the issue @p0fi .

I can't reproduce on Chrome (see attached video), and Firefox works slightly differently (when I hit the back button it shows me the decrypted page even if I didn't check "Remember-me", but no blank page there either).

Stuff that might help: what browser are you using, is it the latest version? Can you detail a little more what's happening for you, maybe attach a screen recording? Are there any errors in the console?

https://github.com/robinmoisson/staticrypt/assets/5664025/de75122b-0895-4675-a51b-66db02afbd07

robinmoisson avatar Feb 26 '24 16:02 robinmoisson

I tried it in Safari (17.3.1 (19617.2.4.11.12)) and Chrome (122.0.6261.69) both browsers behave the same. The page is interestingly not entirely blank, it shows only the image across the top of the page but nothing more. Im afraid I can't give you a screen recording due to the content. But one more interesting thing. Interestingly, if I use the forward button from the almost blank page it navigates forward just fine and renders the entire page. There are no errors in the console when pressing "back". But when loading the initial page it says: Can't create duplicate variable: 'messageHandlers'

p0fi avatar Feb 26 '24 16:02 p0fi

Had similar issue and it was AdBlock. Disabled and issue ceased.

2braincells2go avatar Feb 26 '24 16:02 2braincells2go

That's interesting, thanks for the added information. Still unsure what might be causing this but that gives a few more questions.

  1. Which image on the top of the page are you talking about - is it the loading spinner, or something different?
  2. There are no variable named messageHandlers in staticrypt - does the message show up when you load the encrypted page first, or when you go back and see the broken page? This make me think it could be related to the content of the encrypted page, but it'd be interesting to know if the way staticrypt has of replacing the encrypted page content with the decrypted one does weird stuff to JS evaluation.
  3. To make sure I understand what you're saying with the forward button let me know if that scenario is correct: you (a) go the encrypted page, (b) decrypt it and it shows fine, (c) click a link or navigate away to another page, (d) click the browser Back button and you're shown a broken page (blank with an image on top) - and if (e) you click the forward button you see the decrypted page again?
  4. Maybe most important question, do you see this same behavior when you go to the example page?

robinmoisson avatar Mar 04 '24 10:03 robinmoisson

Cleaning up a bit - I'm closing as "Can't reproduce" for now, but feel free to reply to my last message and re-open the issue if you still see the behavior.

robinmoisson avatar Apr 17 '24 15:04 robinmoisson

Cleaning up a bit - I'm closing as "Can't reproduce" for now, but feel free to reply to my last message and re-open the issue if you still see the behavior.

Sorry for the late answer, busy days....

I am still seeing this behavior, nothing changed. To your points:

  1. It's a different image, our page has a 10px wide line across the top of the page. This image is visible for some reason, the rest of the page is blank white.
  2. The error in the console shows up when loading the de-crypted page (enabled the remember password option)
  3. your understanding is 100% correct
  4. I do not See this behavior on the example page.

Maybe worth mentioning: the page im trying to encrypt is a page generated with retype, see: https://retype.com. Maybe encrypting a sample retype page shows the same behavior helping to debug it.

I can't reopen the issue tho... but I would like to get this fixed :)

p0fi avatar May 02 '24 08:05 p0fi