meta.ai | Performance Optimizer

Fixes sluggish typing in long Meta AI conversations. Kills transition:all bloat, freezes orphaned avatar canvases, adds CSS containment, and prunes hidden node render cost.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Author
piknockyou
Daily installs
1
Total installs
2
Ratings
0 0 0
Version
1.1
Created
2026-05-09
Updated
2026-05-09
Size
34.2 KB
License
AGPL-3.0
Applies to

☕ If you find this tool helpful & would like to support its maintenance, please consider leaving a tip on:

https://ko-fi.com/piknockyou

Thank you! :-)


🖼 For a quick impression of this script, refer to the screenshots at the bottom.


meta.ai | Performance Optimizer

Fixes sluggish typing in long Meta AI conversations. Kills transition:all bloat, freezes orphaned avatar canvases, adds CSS containment, and prunes hidden node render cost.

Why You Need This

Meta AI gets noticeably slow after long chats because:

  • transition:all on every element forces the browser to recalculate every CSS property on thousands of nodes for every keystroke
  • Orphaned avatar canvases keep GPU compositor layers alive even when they are invisible
  • No CSS containment means style and layout changes ripple through the entire chat tree
  • Smooth scroll on huge scrollers causes jank on every programmatic scroll
  • Hidden DOM subtrees continue to consume render and paint time

This script fixes all of that with surgical CSS and JS patches, no features removed.

Key Features

MODULE A — CSS Surgeon

  • Kills transition:all globally and replaces it with a safe subset: color, background-color, border-color, outline-color, opacity
  • Interactive elements also keep transform for smooth buttons
  • Forces scroll-behavior: auto on the chat scroller to eliminate scroll jank

MODULE B — Canvas Freezer

  • Patches HTMLCanvasElement.getContext to track real draws
  • Conservative mode: freezes canvases inside .invisible parents
  • Aggressive mode: also freezes canvases idle for more than 30 seconds
  • Detaches GPU layers to free memory and compositor work

MODULE C — DOM Containment

  • Adds contain: style layout paint to stable chat subtrees
  • Lets the browser skip entire branches during style recalculation
  • Reduces main-thread work when typing

MODULE D — Long Task Monitor

  • Uses PerformanceObserver to detect long tasks over 50ms
  • Automatically suspends cleanup during busy frames so the optimizer never piles on

MODULE F — Periodic Janitor

  • Runs every 10 seconds by default
  • Re-scans for new canvases, prunes hidden nodes, and re-applies freezes
  • Also runs on DOM mutations for SPA navigation

MODULE G — Toolbar UI

  • Floating toolbar in bottom-right with live stats
  • Shows canvases frozen, long task count, max and total long task time
  • Click for settings popover: toggle every module, change modes, force cleanup, reset stats

Smart Behavior

  • Runs at document-start: CSS is injected before first paint to prevent initial jank
  • SPA-safe: MutationObserver watches for Meta AI route changes and re-applies patches
  • Zero visual changes: Only performance properties are touched, the UI looks identical
  • Persistent settings: All toggles are saved with GM_getValue and survive reloads
  • Console logging: Startup summary prints active modules for debugging

Supported Pages

meta.ai: All chat conversations, including long threads with 5,000+ messages

Designed for: Desktop browsers (Chrome, Firefox, Edge) with Violentmonkey or Tampermonkey

Installation

  1. Install a userscript manager:
  2. Install this script
  3. Visit https://www.meta.ai — the toolbar appears automatically

Configuration

All defaults are in the DEFAULT_CONFIG at the top of the script, and are toggleable via the toolbar.

Option Default Description
transitionSurgery true Enable CSS Surgeon
transitionSurgeryScope full full kills transitions globally, minimal only inside chat scroller
canvasFreezer true Enable Canvas Freezer
canvasFreezerMode aggressive aggressive freezes idle canvases, conservative only invisible ones
canvasIdleThresholdMs 30000 Idle time before aggressive freeze
domContainment true Enable DOM containment CSS
longTaskMonitor true Pause cleanup during long tasks
janitorIntervalMs 10000 How often the janitor runs
showToolbar true Show floating stats toolbar

How to Use

Action Result
Hover toolbar See live performance stats
Click toolbar Open settings popover
Toggle a module Instantly applies or removes the patch
Force full cleanup now Runs janitor cycle immediately
Reset stats counters Clears frozen canvas and long task counters
Reset all settings Restores defaults from script

Performance Notes

  • Pure CSS modules (A and C) have zero JS overhead after injection
  • Canvas patch uses a WeakMap so frozen canvases can still be garbage collected
  • Long Task Monitor ensures the script backs off when Meta AI is already struggling
  • Designed for vibe-coded maintenance: all logic is modular and documented inline