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

Browser Back Navigation Does Not Work #193

Open
p0fi opened this issue Feb 26, 2024 · 6 comments
Open

Browser Back Navigation Does Not Work #193

p0fi opened this issue Feb 26, 2024 · 6 comments
Labels

Comments

@p0fi
Copy link

p0fi commented Feb 26, 2024

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 p0fi added the bug label Feb 26, 2024
@robinmoisson
Copy link
Owner

robinmoisson commented Feb 26, 2024

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?

staticrypt-2024-02-26_17.08.07.mp4

@p0fi
Copy link
Author

p0fi commented Feb 26, 2024

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'

@2braincells2go
Copy link

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

@robinmoisson
Copy link
Owner

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
Copy link
Owner

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.

@p0fi
Copy link
Author

p0fi commented May 2, 2024

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 :)

@robinmoisson robinmoisson reopened this May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants