I am trying to debug a login window. Here is what the process is:
- User visits site A
- User clicks to sign in using site B which is an OAuth2 provider
- A popup window opens for site B to prompt the user for their credentials
- When the sign in completes then site B redirects to a designated page of site A.
- Site A will close the popup window and sign the user in using the OAuth2 connect data it acquired from site B.
If a user is already signed in via site B the popup window will open go through the same process but close "instantly" (meaning it jumps straight to the redirect without needing the user's credentials). This happens because site A was pre-authorised to connect via site B by the user in the past.
We control site B but not site A.
Now there is a problem with this process we are trying to diagnose but we are having difficulty. For this we are trying to keep the developer tool window open on the site B popup. The dev tool window opens automatically because I have launched chrome using flag --auto-open-devtools-for-tabs
however when the window closes the devtools tab also closes and I am losing all information of what actually happened during the process. My question is whether it is possible to keep the devtool window open after the window has been closed.
This question is similar to How do I prevent Chrome developer tools from closing when the current browser window closes? but it differs in the following way:
We cannot add a breakpoint for the window unload event because the load and unload happen instantly. What we need is something that never closes the dev tool even after the window is closed.
Is there a way to keep the devtool open or at least save a snapshot of it on unload without having to do this while the window is actually open? Something like a command line flag or a breakpoint we remember?
Edit: I've made partial progress in retaining the network tab log by using --log-net-log=<filename>.json
which dumps all requests in a file to be examined later. While this doesn't actually answer my question, it goes a long way in helping and it is useful enough to mention in case it's useful for anyone else.