• open343@lemmy.zip
    link
    fedilink
    English
    arrow-up
    1
    ·
    6 days ago

    To avoid this problem on Android, I hold down the back button and click on the previous tab.

  • pivot_root@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    edit-2
    8 days ago
    window.history.pushState = () => {}
    window.history.replaceState = () => {}
    

    It’ll break PWAs unless you stub it out properly, but you can throw that in a userscript for a quick and dirty way to disable the API that websites use to update the URL without reloading the page.

    • Lemminary@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      8 days ago

      And SPAs, probably. I can’t imagine anything that relies on React Router to work after this change.

      • pivot_root@lemmy.world
        link
        fedilink
        arrow-up
        3
        arrow-down
        1
        ·
        8 days ago

        Definitely not.

        If I wasn’t on mobile, I would write up a more comprehensive fix. Probably something along the lines of:

        • Store the original functions.
        • Attach a scroll listener to window.
        • Stub the functions when the window is scrolled.
        • Set/reset a timeout for 100ms, and put them back after it fires.