Devpost Submission - Baseline Chrome Extension
Inspiration
As developers, we've all been there: you discover a cool CSS feature like container-queries or @layer, get excited to use it, then spend 20 minutes jumping between MDN, caniuse.com, and blog posts trying to figure out if it's safe for production. This workflow is broken.
The Baseline initiative from web-platform-dx is amazing—it provides clear, standardized compatibility data. But the data lives in npm packages and documentation sites, not in our actual development workflow. We wanted to change that.
What if you could see Baseline compatibility data in real-time, directly on the pages you're building? What if you could hover over any element and see exactly which CSS features it uses? What if an AI could help you understand compatibility issues and suggest solutions?
That's why we built this extension.
What it does
The Baseline Chrome Extension brings web feature compatibility data directly into your development workflow with four powerful modes:
1. Visual Inspect Mode - "X-Ray Vision for CSS" 🔍
The most unique feature: click "Enable Inspect Mode" and your webpage transforms into an interactive compatibility map:
- 🟢 Green dashed borders = Widely available features (safe to use)
- 🟡 Yellow solid borders = Newly available features (use with caution)
- 🔴 Red solid borders = Limited support features (needs polyfills)
- Hover tooltips show exactly which CSS features each element uses
- Page indicator displays feature breakdown in real-time
It's like having X-ray vision for your CSS—you can literally see compatibility issues on the page.
2. Page Auditor 📊
Real-time detection of CSS and JavaScript features:
- CSS Detection: Scans 100+ properties using
document.styleSheetswith CORS fallback - JS Detection: Uses Acorn AST parser to detect 215+ APIs with confidence scoring
- Smart Mapping: Automatically maps CSS properties to web-features (e.g.,
display: grid→ CSS Grid feature) - Universal Compatibility: Works on ANY website—Framer sites, CDN-hosted pages, custom frameworks
3. DevTools Panel 🛠️
Detailed feature breakdown with professional tooling:
- Filterable table by Baseline status (Widely/Newly/Limited)
- Search functionality across feature names
- Direct links to MDN 📖 and CanIUse 📊 documentation
- JSON export for CI/CD integration
- Per-file detection showing where features are used
4. AI Chat Assistant 🤖
Google Gemini 2.0 Flash integration for intelligent assistance:
- Context-aware responses based on detected features
- Quick actions: "Suggest polyfills", "Generate browserslist config", "Create migration plan"
- Chat history persistence
- Understands your specific compatibility challenges
5. Docs Enhancer 📚
Injects Baseline badges directly on documentation sites:
- MDN articles get color-coded badges showing Baseline status
- web.dev tutorials show compatibility info inline
- caniuse.com pages get enhanced with Baseline data
- Non-intrusive design that enhances, not disrupts
How we built it
Architecture
- Manifest V3 Chrome Extension for modern security and performance
- web-features npm package (1,087 features) as the source of truth
- Vanilla JavaScript (~7,000 LOC) - no heavy frameworks, fast and lightweight
- Acorn parser for accurate JavaScript AST analysis
- Google Gemini 2.0 Flash API for AI-powered assistance
Key Technical Innovations
1. AST Parsing for JS Detection
Instead of simple regex matching, we use Acorn to parse JavaScript and detect API usage with confidence scoring:
// Detects: fetch(), Promise, async/await, etc.
const ast = acorn.parse(code, { ecmaVersion: 2024 });
walk.simple(ast, {
CallExpression(node) {
if (node.callee.name === 'fetch') {
features.add('fetch');
}
}
});
2. Smart CSS Property Mapper
60+ mappings that bridge CSS properties to web-features:
const propertyMap = {
'display': ['flexbox', 'grid', 'subgrid'],
'transform': ['transforms2d', 'transforms3d'],
'container-type': ['container-queries']
};
3. CORS Fallback for Universal Compatibility
When external stylesheets are blocked by CORS, we sample computed styles:
// Fallback: sample 100 random elements
const elements = document.querySelectorAll('*');
const sample = Array.from(elements).slice(0, 100);
sample.forEach(el => {
const styles = getComputedStyle(el);
detectCSSFeatures(styles);
});
This makes the extension work on ANY website—Framer, Webflow, CDN-hosted sites, everything.
4. Visual Overlay System
Dynamic element highlighting with performance optimization:
// Create overlay divs that track element positions
elements.forEach(el => {
const rect = el.getBoundingClientRect();
const overlay = createOverlay(rect, baselineStatus);
overlay.addEventListener('mouseenter', showTooltip);
});
5. Neo-Brutalism UI Design
Bold, modern design that stands out:
- 3px solid black borders on everything
- Hard shadows (4px 4px 0px 0px) with no blur
- Vibrant colors: Orange (primary), Lime Green (secondary), Purple (accent)
- DM Sans font for UI, Space Mono for code
- Interactive hover effects: elements "lift" and cast larger shadows
Development Timeline
- Day 1: Foundation (extension structure, data loader, evaluator)
- Day 2: Page Auditor (CSS/JS detection, popup UI)
- Day 3: DevTools panel + Docs Enhancer
- Day 4: Visual Inspect Mode + AST parsing
- Day 5: AI integration + Neo-brutalism UI refresh
Challenges we ran into
1. CORS Restrictions on External Stylesheets
Problem: Many websites load CSS from CDNs (Google Fonts, Bootstrap CDN, etc.). Chrome blocks access to external stylesheets due to CORS policy.
Solution: We built a fallback system that samples computed styles from 100 random elements when stylesheet access fails. This maintains accuracy while respecting security boundaries.
2. Mapping CSS Properties to Web Features
Problem: The web-features package uses feature IDs like flexbox and grid, but CSS uses properties like display: flex and display: grid. How do we bridge this gap?
Solution: We created a comprehensive mapping system with 60+ rules:
if (property === 'display') {
if (value.includes('flex')) features.add('flexbox');
if (value.includes('grid')) features.add('grid');
}
3. Accurate JavaScript Detection
Problem: Simple regex matching produces false positives (e.g., detecting fetch in comments or strings).
Solution: We integrated Acorn AST parser to analyze actual code structure. This gives us 95%+ accuracy with confidence scoring for each detection.
4. Performance of Visual Overlay
Problem: Highlighting hundreds of elements with overlays caused lag on complex pages.
Solution:
- Virtualization: only render overlays for visible elements
- Debounced scroll/resize handlers
- CSS transforms instead of position changes
- RequestAnimationFrame for smooth updates
5. AI Context Awareness
Problem: Generic AI responses aren't helpful. We needed context-aware suggestions based on detected features.
Solution: We built a context builder that sends detected features to Gemini:
const context = `
Detected features:
- container-queries (limited support)
- flexbox (widely available)
- grid (widely available)
User question: ${userMessage}
`;
Accomplishments that we're proud of
🏆 Visual Inspect Mode
This is our crown jewel. No other browser extension offers "X-ray vision for CSS". It's:
- Educational: Developers learn which features their elements use
- Interactive: Hover tooltips provide instant feedback
- Beautiful: Color-coded overlays are visually intuitive
- Universal: Works on ANY website, not just localhost
🎨 Neo-Brutalism UI
We ditched the typical "LLM purple gradient" aesthetic and created a bold, modern design:
- Consistent across all 3 interfaces (DevTools, Popup, AI Sidebar)
- Interactive hover effects that feel premium
- Accessible color contrast
- Professional typography
🤖 AI Integration
Context-aware Gemini responses that actually help:
- "Suggest polyfills for limited features" → generates npm install commands
- "Generate browserslist config" → creates production-ready config
- "Migration plan" → step-by-step upgrade guide
🔬 AST Parsing
Accurate JavaScript detection beyond simple heuristics:
- 215+ APIs tracked
- Confidence scoring (high/medium/low)
- Handles minified code
- No false positives from comments/strings
🌍 Universal Compatibility
Works on every website we tested:
- Framer sites (external CSS)
- Webflow sites (inline styles)
- CDN-hosted pages (Bootstrap, Tailwind)
- Custom frameworks (React, Vue, Svelte)
- Static HTML pages
What we learned
Technical Learnings
- Chrome Extension Architecture: Manifest V3's service worker model, content script isolation, and message passing
- AST Parsing: How to use Acorn to analyze JavaScript code structure
- CORS Workarounds: Creative solutions for accessing cross-origin resources
- Performance Optimization: Virtualizing overlays, debouncing events, using transforms
- AI Integration: Building context-aware prompts for better responses
Design Learnings
- Neo-Brutalism: Bold borders and hard shadows create visual hierarchy without gradients
- Color Psychology: Orange (action), Lime (success), Purple (intelligence) communicate meaning
- Typography: DM Sans for readability, Space Mono for code creates professional contrast
- Interaction Design: Hover effects that "lift" elements feel more tactile and engaging
Product Learnings
- Developer Workflow: Developers want data in context, not in separate tabs
- Visual Feedback: Seeing compatibility issues on the page is more powerful than reading tables
- AI Assistance: Generic chatbots aren't helpful; context-aware suggestions are game-changing
- Progressive Enhancement: Start with basic detection, add advanced features (AST, AI) later
What's next for Baseline Chrome Extension - Real-Time Compatibility Checker
Short-term (Post-Hackathon)
Custom Baseline Targets
- Let users define their own browser support matrix
- "I need to support Safari 15+" → recalculate all feature statuses
- Save presets for different projects
Enhanced Inspect Mode
- Click to "lock" tooltip (don't require hover)
- Side-by-side comparison mode (before/after polyfills)
- Screenshot mode with annotations
Framework Support
- React component detection (which components use which features)
- Vue/Svelte integration
- Show feature usage per component, not just per file
Medium-term
CI/CD Integration
- Command-line tool for automated testing
- GitHub Action for PR checks
- Fail builds if limited-support features are added
Team Collaboration
- Share feature reports with team
- Annotate features with notes ("we need polyfill for this")
- Track feature adoption over time
Browser Extensions
- Firefox port (WebExtensions API)
- Safari port (Safari Web Extensions)
- Edge optimization (already works, but could be better)
Long-term Vision
Analytics Integration
- Netlify/Vercel plugin showing feature usage
- Real user monitoring: which features cause issues in production
- Automatic polyfill suggestions based on actual user browsers
AI Enhancements
- Auto-generate polyfill bundles
- Suggest alternative implementations
- Code refactoring suggestions ("use this instead of that")
Community Features
- Share feature detection rules
- Crowdsourced compatibility data
- Plugin system for custom detectors
Why This Matters
The web platform is evolving faster than ever. CSS Container Queries, CSS Cascade Layers, View Transitions API—amazing features are landing constantly. But adoption is slow because developers don't know what's safe to use.
Baseline solves the "what's safe" problem. Our extension solves the "how do I use Baseline in my workflow" problem.
We're not just building a tool—we're building a bridge between the Baseline initiative and real-world development. We're making web feature adoption faster, safer, and more accessible for everyone.
Built with ❤️ for the Baseline Tooling Hackathon 2025
Built With
- ast-parsing
- css3
- gemini
- javascript
- manifest-v3
Log in or sign up for Devpost to join the conversation.