A JavaScript bookmarklet that diagnoses performance issues in your webpage's <head>
section.
This tool provides a visual report of blocking scripts, third-party resources, and other elements that might impact your page's performance. It's a slightly enhanced version of Harry Roberts’ original CT Scan CSS tool, rewritten in JavaScript to avoid CSP restrictions and with an improved UI.
Key Features
Some time ago, I discovered the powerful CT Scan CSS by Harry Roberts (𝕏 @csswizardry) — a super-clever diagnostic tool that analyzes any webpage's <head>
section to spot render-blocking resources and potential performance bottlenecks. The original tool (CT.css ➚ | GitHub ➚) works by injecting CSS into your page to visualize problematic elements.
While using Harry's original bookmarklet, I kept running into a few challenges:
This inspired me to create CT Scan v2: a JavaScript-based rewrite that maintains the core functionality while addressing these issues and adding a couple new features like an export option and improved visual indicators.
Of course, I am not a skilled programmer. Did I use LLMs to convert this? Yes I did. A skilled coder could doubtless do better! (Please do!)
So, like any quick diagnostic tool, CT Scan v2 still comes with a few limitations you should know about (very much like the first one):
Stylesheet Analysis | All stylesheets are flagged as "render-blocking" regardless of their media attribute. Media-specific or print-only CSS may show warnings even when they don't impact rendering. |
---|---|
Runtime DOM ONLY | The tool analyzes the current state of the DOM. Elements injected after you run the tool (or removed before) won't be included in the report. |
Simple Origin Detection | Third-party resources are detected using a basic ^https?:// pattern check, which may produce false positives (same-origin CDNs) or miss protocol-relative URLs. |
UI Modifications | The tool temporarily converts fixed/sticky elements to static positioning to prevent the report from being obscured. This may briefly alter your page layout. |
State Preservation | Running the tool twice will restore the page, but scroll position and dynamic UI state may not be preserved exactly. |
Simplified Heuristics | The tool uses tag and attribute checks to identify issues, not a complete render-path analysis. Treat the results as guidance, not absolute truth. |
Unlike Harry’s original bookmarklet, CT Scan v2 applies all styling via JavaScript's element.style
property rather than injecting <style>
tags. This avoids triggering Content Security Policy restrictions that block inline styles.
When you run the Head Inspector bookmarklet, you'll see a color-coded report at the top of your page like this: