Skip to content

Instantly share code, notes, and snippets.

@carcinocron
Last active April 20, 2026 11:57
Show Gist options
  • Select an option

  • Save carcinocron/f6a509b84fe82a718816 to your computer and use it in GitHub Desktop.

Select an option

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)
@vuhanguyen
Copy link
Copy Markdown

Awesome!!

@ot-johnny-davila
Copy link
Copy Markdown

thank you

@ducqhl
Copy link
Copy Markdown

ducqhl commented Aug 29, 2021

Thank a lot, man.

@4amparaboy
Copy link
Copy Markdown

Awesome

@chenxiaoyao6228
Copy link
Copy Markdown

Thank a lot, man.

@shinusuresh
Copy link
Copy Markdown

That's so nice

@jasonleow
Copy link
Copy Markdown

Saved my life! Thank you πŸ’ͺπŸ’ͺπŸ’ͺ

@snowman
Copy link
Copy Markdown

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
Copy Markdown

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