An AI-powered browser extension leveraging Google Gemini to intelligently evaluate and fill content.
FillAI is a modern browser extension built with React, TypeScript, and Vite. It integrates seamlessly with the Google Gemini API to analyze page content and assist users through intelligent heuristics and LLM-driven actions.
- AI-Powered Assistance: Utilizes the Google GenAI SDK for advanced content generation and analysis directly in the browser.
- Modern UI/UX: Built with React 19 and Framer Motion for smooth, interactive popup and option views.
- Modular Architecture: Clean separation of background scripts, content scripts, popup, and options pages.
- Fast Development: Scaffolded with Vite for lightning-fast HMR and optimized builds.
- Node.js (v18 or higher recommended)
- A Google Gemini API Key
-
Install dependencies:
npm install
-
Environment Setup: Create a
.env.localfile in the root directory and add your Gemini API key:GEMINI_API_KEY=your_gemini_api_key_here
-
Start Development Server (UI Preview): To run the standalone web view for testing UI components independently:
npm run dev
-
Build the extension files:
npm run build:ext
This will compile the background scripts, content scripts, and UI assets into the
dist-extdirectory. -
Load into Chrome or Edge:
- Open your browser and navigate to the Extensions page (
chrome://extensions/oredge://extensions/). - Enable Developer mode (toggle in the top right).
- Click Load unpacked.
- Select the
dist-extfolder generated in the previous step.
- Open your browser and navigate to the Extensions page (
The content script now checks whether the current page is a meaningful form page before showing/running page-level autofill.
- Detector module:
src/utils/formDetector.ts - Entry point integration:
src/content/index.ts
- Counts visible, enabled fields from:
input[type="text"]input[type="email"]input[type="tel"]input[type="number"]textareaselect
- Hidden and disabled fields are ignored.
- Page text scan checks first ~2000 chars for form-intent keywords.
- Scoring:
+2if fields>= 3+2if<form>exists and fields>= 2+1if keyword match and fields>= 2- returns
truewhen score>= 3
- Hard exclusion: if total eligible fields
<= 1, returnsfalse.
- Trigger mounting is re-checked shortly after load and on DOM mutations.
- This supports delayed/SPA-rendered forms without polling loops.
Enable in page DevTools console:
localStorage.setItem('fillai:formDetectorDebug', '1')Disable:
localStorage.removeItem('fillai:formDetectorDebug')When enabled, detector logs include:
totalFieldshasFormkeywordMatchscore
- Build and load extension:
npm run build:ext- Reload unpacked extension from
dist-ext.
- Open each page type and verify behavior:
- Login/Register page → Autofill trigger appears.
- Job application/Contact page → Autofill trigger appears.
- Search homepage (single search box) → trigger does not appear.
- Blog/article page (no meaningful fields) → trigger does not appear.
- Chat UI with single message box → trigger does not appear.
- For delayed forms (SPA/modal):
- Navigate/open form after initial page load.
- Confirm trigger appears once fields are rendered.
- With debug enabled, verify logs match expectations for
totalFieldsandscore.
FillAI uses a lightweight cache in chrome.storage.local (fillai_cache) for successful LLM outputs only.
- Module:
src/utils/cache.ts - Integration:
src/services/fieldProcessor.ts(LLM path only)
- Simple fields (
full_name,first_name,last_name,email,phone,linkedin):- key uses
fieldType + profile.fullName
- key uses
- Context fields (essay/complex and everything else):
- key uses
fieldType + hostname + normalizedTitle + label - title normalization lowercases, removes
- | –noise, collapses spaces, and truncates to 80 chars
- key uses
- TTL:
24h(24 * 60 * 60 * 1000) - Expired entries are deleted on read
- Max size:
100entries - Oldest entries are evicted when limit is exceeded
Cache writes happen only when all are true:
- source is LLM
- value is non-empty
- value length is
>= 20 - classifier confidence is
>= 0.6
Heuristic outputs are never cached.
On read:
console.log('[Cache] HIT:', key)console.log('[Cache] MISS:', key)
- Framework: React 19
- Build Tool: Vite
- Language: TypeScript
- AI Integration:
@google/genai - Styling/Animation: Motion