microsoft / microsoft/pxt

Chromium based browsers freeze when pxt is removed from DOM

Open
#7,991 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
641
Avg merge
12h 4m
Merged PRs (30d)
57

Description

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
    • http://localhost:3232/controller.html
  9. Remove iframe node from browser console
document.getElementById('iframe').parentElement.removeChild(document.getElementById('iframe'))
  1. The browser window should be unresponsive at this moment

Desktop:

  • OS: macOS Big Sur Version 11.2.1
  • Browser:
    • Google Chrome Version 89.0.4389.90 (Official Build) (x86_64)
    • Brave Version 1.21.77 Chromium: 89.0.4389.90 (Official Build) (x86_64)

Additional questions

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the freeze using the steps in the issue, serving pxt-sample and opening controller.html in a Chromium-based browser. Start by tracing the iframe removal and its related TypeScript/browser lifecycle code; done means removing the iframe no longer makes the tab unresponsive while Firefox behavior remains unaffected.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.