Skip to content

Instantly share code, notes, and snippets.

@carcinocron
Last active April 25, 2024 16:48
Show Gist options
  • Save carcinocron/f6a509b84fe82a718816 to your computer and use it in GitHub Desktop.
Save carcinocron/f6a509b84fe82a718816 to your computer and use it in GitHub Desktop.
Chrome: pause before redirect
// Run this in the F12 javascript console in chrome
// if a redirect happens, the page will pause
// this helps because chrome's network tab's
// "preserve log" seems to technically preserve the log
// but you can't actually LOOK at it...
// also the "replay xhr" feature does not work after reload
// even if you "preserve log".
window.addEventListener("beforeunload", function() { debugger; }, false)
@4amparaboy
Copy link

Awesome

@chenxiaoyao6228
Copy link

Thank a lot, man.

@shinusuresh
Copy link

That's so nice

@jasonleow
Copy link

Saved my life! Thank you 💪💪💪

@snowman
Copy link

snowman commented Mar 11, 2023

bump, really save life, otherwise the original URL is lost when 302 auto redirected to page saying this region is not available, and there is not the history entry for original URL, neither switch back.

-- Edit
okay, I did not try it before I reply, what I saying here is not the feature to pause redirection automatically in the background, means you have to open devtools console beforehand to run the code first. Google leads me to here, but now it's time to go

@jrt324
Copy link

jrt324 commented Mar 15, 2023

greate idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment