question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chrome shows prompt dialog for "Restore Pages" after every debugging session.

See original GitHub issue

Describe the bug

After a normal debugging session, launching another debugging session always shows “Restore Pages? Chrome did not shutdown correctly.”

Screenshot of annoying dialog

To Reproduce Steps to reproduce the behavior:

  1. Opened the following project in vs code via; “Remote-Containers: Open repository in container” https://github.com/akutruff/conway-life-react-redux

In container terminal:

cd app
yarn install
yarn start
  1. Run debugger. Close page either via “x” on chrome or stopping in the debugger.

  2. Reopen chrome.

Log File vscode-debugadapter-1.json.gz

VS Code Version: 1.48.2

Additional context I have tried setting up a separate debug profile. Other people experiencing this problem used to use a command line flag that Chrome has since removed. This has been tried:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:3000",
            "webRoot": "${workspaceFolder}",
            "userDataDir": false,
            "runtimeArgs": [
                "--profile-directory=debug-profile",
                "--noerrors", "--disable-session-crashed-bubble", "--disable-infobars"
              ],
            "trace": true
        }
    ]
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
pcjmfrankencommented, Jan 26, 2021

I was encountering this issue today with VSCode 1.52.1 and Debugger for Chrome extension 4.12.11.

Adding "browserLaunchLocation": "ui" to the launch config seems to have fixed the “restore pages” issue for me. It does take a few seconds to start up the browser with this setting though.

This issue has only ever occurred for me when launching Chrome through a debug launch config. I have never had the restore pages popup when launching a Chrome debug window through the commandline. It also seemed to happen more often after having stopped the previous Chrome debug session through the VSCode UI stop button (or shift+f5), rather than quitting Chrome through the application menubar.

Current config (relevant parts):

    {
      "name": "Launch Chrome",
      "type": "pwa-chrome",
      "request": "launch",
      "browserLaunchLocation": "ui",
      "url": "http://localhost:3000",
      "userDataDir": "${workspaceFolder}/.vscode/debug-profile-chrome",
      "webRoot": "${workspaceFolder}",
      "skipFiles": ["<node_internals>/**"]
    }

Probably unrelated but who knows: That same UI stop button also seems to gracelessly kill node processes that were launched from a launch config, sometimes resulting the following session to fail with a segfault error.

Quiting through the VSCode UI: zsh: killed /usr/bin/env [userdir]/.nvm/versions/node/v14.15.4/bin/node --inspect Quiting by doing a ctrl+c in the terminal: Waiting for the debugger to disconnect...

2reactions
navelscommented, Jun 22, 2021

I was encountering this issue today with VSCode 1.52.1 and Debugger for Chrome extension 4.12.11.

Adding "browserLaunchLocation": "ui" to the launch config seems to have fixed the “restore pages” issue for me. It does take a few seconds to start up the browser with this setting though.

You are my hero

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable Chrome session restore popup
Follow these steps: Open Chrome. Type chrome://flags/#infinite-session-restore in address bar ( Crtl + L ). Click on the right drop-down menu ...
Read more >
Google Chrome always gives the "restore session" option ...
i.e. if you do the following: 1. Start Google Chrome 2. Quit Google Chrome, wait 5 seconds 3. Start Google Chrome does that...
Read more >
Chrome restore pages message when debugging ASP.NET
The next time I start debugging, Chrome displays an annoying message: "Restore pages? Chrome didn't shut down correctly" that I have to manually...
Read more >
How to Restore Tabs on Chrome: Restore Your Last ...
You can click this option to restore your previous session. The Ctrl+Shift+T command can also reopen crashed or closed Chrome windows. You can ......
Read more >
How to Restore Tabs on Chrome, No Matter What
Enable setting to restore tabs after restart - To prevent this from happening again! 1. How to reopen closed tabs on Chrome. It...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found