microsoft / pxt

Microsoft MakeCode (PXT - Programming eXperience Toolkit)
https://makecode.com
MIT License
2.07k stars 577 forks source link

Chromium based browsers freeze when pxt is removed from DOM #7991

Open barbero-oe opened 3 years ago

barbero-oe commented 3 years ago

The browser's tab freezes when pxt is removed from the DOM. This happens on chromium based browsers. It does not happen in firefox.

To Reproduce

  1. Clone pxt repository (https://github.com/microsoft/pxt.git)
  2. Clone pxt sample (https://github.com/microsoft/pxt-sample.git)
    • The folder structure should look like this:
    • bug-report/ |- pxt/ |- pxt-sample/
  3. Install pxt globally (npm install -g pxt)
  4. Install dependencies on both projects
  5. Build local pxt (cd pxt; npm run build)
  6. Link pxt-sample with local pxt (Deletion of pxt-sample/node_modules/pxt-core/ might be necessary)
    • cd pxt-sample; pxt link ../pxt
  7. Serve pxt-sample with custom pxt
    • pxt serve
  8. Open on Chrome the controller example
  9. Remove iframe node from browser console
    document.getElementById('iframe').parentElement.removeChild(document.getElementById('iframe'))
  10. The browser window should be unresponsive at this moment

Desktop:

Additional questions

Should I send a message to pxt before closing? If so, which one?

jfo8000 commented 3 years ago

Are you sure this is not a bug in chrome devtools?
I definitely had some bad weather with freezing devtools for a few releases.