3 ms·
When you have a single "top level browsing context", ie. a window, iframe or worker, it's mostly impossible to unload JS code that had been loaded. By using ifr
by fabrice_d 8y ago
When you have a single "top level browsing context", ie. a window, iframe or worker, it's mostly impossible to unload JS code that had been loaded. By using iframes and workers you can actually control the unloading of useless code. Workers of course also help with offloading the main thread.
The overhead of allocating a new js runtime is not that high in modern browsers anymore so that's an acceptable trade off.