This project shows a memory leak that can occur if code on the main window awaits a promise from within the iframe before performing memory cleanup. If the iframe is removed before the iframe promise resolves, the awaiting function will halt execution and cleanup code will never run.
For more details see it running live.
- Clone this repo by running
git clone https://github.com/astegmaier/playground-hung-iframe-promise.git
- Change into the directory by running
cd playground-hung-iframe-promise
- Ensure nodejs is installed.
- Run
npx http-server
to start a local server. You can also installhttp-server
globally by runningnpm install -g http-server
and then runninghttp-server
directly. - Open
http://localhost:8080/
in your browser.