1. 程式人生 > >Why do Google webapps use so many iframes (and web workers)?

Why do Google webapps use so many iframes (and web workers)?

Poking around Google with a browser dev console open, I noticed that Google apps like Gmail use almost 10 unique JavaScript contexts, iframes and webworkers. Facebook doesn't even have one. In fact I couldn't find another major website with more than 1 or 2 (Amazon has 2). So each tab of each google webapp is allocating 10 jsvms and up to 10 DOMs. That seems excessive. What's going on? Why do Google's webapps need so many top-level jsvms compared to their competitors?