microsoft / vscode-edge-devtools

A VSCode extension that allows you to use browser devtools from within the editor. The devtools will connect to an instance of Microsoft Edge giving you the ability to alter CSS styling, perform diagnostics, and debugging. Get it now at http://aka.ms/devtools-for-code
https://docs.microsoft.com/microsoft-edge/visual-studio-code/microsoft-edge-devtools-extension
MIT License
744 stars 249 forks source link

Extention Closes the Browser tab/window when disconnecting from debug #1708

Open fshahin90 opened 1 year ago

fshahin90 commented 1 year ago

Environment (please complete the following information):

Describe the bug:

when attaching the vscode debugger to microsoft edge to debug my angular application then disconnecting the debugger the browser window closes.

Repro steps:

  1. create angulr app
  2. config debugger to attach to microsoft edge
  3. run the attach debugger
  4. disconnect the debugger

Expected behavior:

the browser wndow/tab should not close and stay open

Additional context:

additionally the extention puts the page in a freez state after i reopen the website again and will not continue execution untill i open the developer tools by pressing (F12)

captainbrosset commented 1 year ago

Thanks for the report.

I wonder if this is due to the Edge DevTools, or just to the way VS Code debugs websites. When VS Code starts a debugging session with a browser, it starts that browser and attaches to it. So it seems understandable that it would close that same browser when the debugging session ends.

@fshahin90 maybe what you're looking for is a way for you to open your own browser window first, and then start and end multiple debugging sessions without the browser window closing every time. Is that correct?

@vidorteg I don't know enough about how things work here. Can you shade some light on how browser windows get opened, and whether what @fshahin90 wants to do is possible today?

fshahin90 commented 1 year ago

@captainbrosset thanks for the reply VS Code does have the ability to attach to an already opened browser/tab below is the settings for the attach

{
            "name": "Attach to Edge",
            "port": 9222,
            "request": "attach",
            "type": "msedge",
            "url": "http://localhost:4200/*",
            "webRoot": "${workspaceFolder}/webapp",
            "sourceMaps": true,
            "address": "localhost",
            "disableNetworkCache": true
        }

how i know that its from the extention is that i disabled the vs-code-edge-tools extention then tried and the browser/tab didnt close and when i re enabled the extention the problem returned

hope this cleared some of the questions

captainbrosset commented 1 year ago

Oh that's great feedback. Thanks a lot. So, to sum up, you're attaching to an already running Edge process, and when detaching, the process is killed, but only when the extension is installed. That definitely sounds like a bug then.

Over to @vidorteg and the rest of the team for prioritization and investigation then.