#notalljavascript (How to deal with 3rd party JS)
summary
AMP shows concrete defenses: measure visibility with IntersectionObserver instead of expensive getBoundingClientRect polling, contain third‑party code in an iframe sandbox so it can be killed and sized safely, and throttle timers by monkey‑patching setTimeout/setInterval/requestAnimationFrame (adding ~1s when offscreen) to keep the page usable. Examples include pages with 65 Flash objects, ads spawning up to 21 movies, and a JS H.264 decoder that broke performance, and the mitigations demonstrably reduce jank.
AI-written summary · about
chapters (12)
- 0:00Intro
- 0:48JavaScript is my favorite programming language.
- 1:21JavaScript is frickin awesome
- 2:27When your app starts, it makes an insecure HTTP request to my server and runs some arbitrary native code.
- 3:36Flash movies reduce their frame rate when off screen.
- 3:55I can use Flash to measure whether something is on screen.
- 7:37How does a browser parse a web page?
- 9:12Every JavaScript API will eventually be asynchronous.
- 11:42TECHNOLOGY LAB Native JavaScript H.264 decoder offers compelling demo of JS performance Mozilla has released "Broadway," a native JavaScript-based H.264 decoder that
- 12:04Chrome and Safari do not allow the tag to autoplay on mobile.
- 12:59Bandwidth still used -Battery devastated - Page janks - Only the bad players get to play video.
- 15:14Better security Control over resizing Ability to cleanly unload
related talks
20m"Mitigating Advertising Impact on Page Performance"
13m"Don't Let Third Parties Slow You Down"
24mYou don't need AMP for that
40mHostile JavaScript: Attacking and Defending the Browser
01h 04mJavaScript's Most Wanted
41mBrowser Internals for JS Devs
29miframes: A look in to the black heart of the browsers
26mScripting in the 3rd Party True Tales of Horror and Hope
