vuejs / devtools-v6

⚙️ Browser devtools extension for debugging Vue.js applications.
https://devtools-v6.vuejs.org/
MIT License
24.68k stars 4.14k forks source link

fix: chrome crashing on closing dev tools (fix #2103) #2148

Open tiagoroldao opened 8 months ago

tiagoroldao commented 8 months ago

Description

Fixes #2103 When closing devtools, an infinite loop is triggered by the line: https://github.com/vuejs/devtools/blob/963ff7fe1470aa5b2a93a8a8afadc57fa3c38676/packages/shell-chrome/src/backend.js#L47

After closing devtools, the window.postMessage call in backend.js triggers the event listener in the same file, and as the reaction to a message is to postMessage back, an infinite loop is triggered this way.

Additional context

To the best of my knowledge:


What is the purpose of this pull request?

Before submitting the PR, please make sure you do the following