Chrome extension to streamline customer support via ChatMix, integrated with SGP.
π§π· PortuguΓͺs Β· πΊπΈ English
| Button | Description |
|---|---|
| π€ Contact | Copies formatted name and phone number |
| π€ Chat | Generates a clean AI prompt from the chat history |
| π CPF | Copies the CPF/CNPJ detected in the messages |
| π O.S | Opens the service order creation modal |
| π Refresh | Clears cache and reloads client data |
| Opens the client's profile directly in SGP | |
| π¬ Chat | Internal Chat for agent communication |
- Live Embed: Loads the official ATI chat system via a high-performance Iframe.
- Background Monitor: Polls Firebase for new messages even when the extension is closed.
- Smart UI: Floating blue button with "active" state detection.
- Badge Alerts: Visual "!" indicator on the extension icon for unread messages.
- Sector Monitoring: Monitors geral, ti, financeiro, suporte and comercial rooms.
- Contract selection with real-time Online/Offline status
- Occurrence type selector with search
- Per-agent O.S templates
- Automatic form fill in SGP
- Auto-draft β saves text as you type and restores on reopen
- Automatically cleared when the attendance is closed
- Categorized quick replies injected above the message input
- Two-level navigation: categories β replies
- One-click insert into the text field
- In-memory cache β single Firebase read per session
- Clean history: strips automation messages, transfers and bot menus
- Identifies client vs agent messages from the DOM
- Ready to paste into ChatGPT, Claude or any AI
- Firebase-backed per-agent login
- Session persisted in
chrome.storage.local - Access control by status (
active/ blocked)
src/
βββ background/ # Service Worker (network & CORS logic)
β βββ index.ts # Entry point β message listener
β βββ firebase.ts # Auth, templates and quick replies
β βββ sgp/
β βββ constants.ts # URLs, TTLs and interfaces
β βββ cache.ts # Form cache (max 50 entries)
β βββ auth.ts # SGP login with session cache
β βββ search.ts # Client search (CPF, name, phone)
β βββ contracts.ts # Contracts + online/offline status
β βββ occurrence.ts # Forms, occurrences and tab management
β
βββ contentScript/
β βββ chatmix/
β β βββ index.ts # Entry point β buttons, observer, init
β β βββ state.ts # Global state, selectors, debug
β β βββ helpers.ts # CPF/CNPJ, formatting, setNativeValue
β β βββ getClientData.ts # DOM data extraction
β β βββ buildAIPrompt.ts # AI prompt generator
β β βββ Quickreply.ts # Quick replies with in-memory cache
β β βββ style.css
β β βββ auth/
β β β βββ firebase.ts
β β β βββ session.ts
β β β βββ login.ts
β β β βββ loginModal.ts
β β β βββ login.css
β β βββ os/
β β βββ osModal.ts # Full service order modal
β β βββ osDraft.ts # Per-chat draft in sessionStorage
β β βββ osModal.css
β βββ sgp/
β βββ actions.ts
β βββ fillForm.ts
β βββ sgpFill.js
β βββ types.ts
β
βββ popup/
β βββ Popup.html
β βββ Popup.tsx
β βββ Popup.css
β βββ main.tsx
β
βββ assets/
β βββ logo.png
β
βββ global.d.ts
βββ manifest.ts
- React 18 + TypeScript β Popup UI
- Vite β Manifest V3 build pipeline
- Firebase Realtime Database β Templates, quick replies and auth
- Chrome Extensions API β Storage, Tabs, SidePanel
- MutationObserver with debounce β Attendance change detection
- Node.js 18+
- npm or yarn
git clone https://github.com/Vituali/Chrome-Extension-ATI-V2.git
cd Chrome-Extension-ATI-V2
npm install# Development build with watch
npm run build -- --watch
# Production build
npm run build
# Build and package for Chrome Web Store submission
npm run zip- Go to
chrome://extensions/ - Enable Developer mode
- Click Load unpacked
- Select the
dist/folder
The admin panel is available at vituali.github.io/ATI, where administrators can:
- π₯ Manage agents (create, block, assign roles)
- π Create and edit O.S templates per agent
- β‘ Create and edit quick replies with categories and subcategories
admins/{uid} β true
atendentes/{username} β { email, nomeCompleto, role, uid, status }
modelos_os/{username}/{id} β { id, title, text, category, occurrenceTypeId }
respostas/{username}/[] β { category, subCategory, text, title }
- β Internal Chat Embed β Migrated chat logic to an Iframe-based system for instant updates.
- β Background Notifications β Real-time polling of message metadata with browser alerts.
- β Extension Badge β Icon badge "!" for unread messages.
- β Performance Fixes β Resolved Vite build errors and optimized Service Worker memory.
- β
Memory Cache on Service Worker β Migrated from global variables to
chrome.storage.sessionto prevent data loss during SW suspension. - β Pending SGP Data Fix β Storage keys now include a unique client identifier to prevent race conditions during simultaneous chats.
- β
Parallel SGP Searches β Name and Phone searches now run in parallel via
Promise.allwhen CPF returns no results, reducing load time. - β Smart Tab Navigation β SGP button now detects existing client tabs by page title and focuses them instead of opening duplicates.
- β
Security Hardening β Removed
innerHTML(replaced withtextContent), and implementedcrypto.randomUUID()validation forpostMessageorigins. - β Server Selector Respected β All generated URLs (contracts, services, autocomplete) now strictly follow the user-selected server.
- β
Blocking Dialogs Removed β replaced
alert()andconfirm()with non-blocking Toasts and React modals. - β Optimized MutationObserver β restricted target to the specific sidebar/message container with a 150ms debounce.
- β Status Colors for contracts (Active, Reduced Speed, Suspended, etc.)
- β Design System standardized with rgba transparencies and :hover states
- β Status Summary and counter in the client selection modal
- β osModal refactored into sub-modules (UI, SGP, Handlers, Types)
- β Zero any in firebase.ts and cache.ts with strict TypeScript interfaces
- β Online status refresh without reloading the entire SGP form
- β ExtensionRequest standardized for all Background/Content messaging
- β botPatterns isolated for clean chat history stripping
- β CLAUDE.md context-shielded with strict naming rules for AIs
- β Online/Offline status for contracts in the O.S modal
- β
Background refactored into modules (
firebase,sgp/auth,sgp/contracts, etc.) - β
Auto-draft per attendance in
sessionStorage - β Quick reply in-memory cache β single Firebase read per session
- β MutationObserver debounce β Vue virtual scroller compatibility
- β Guards against simultaneous inits and duplicate loads
- β SGP form cache capped at 50 entries
- β
AbortSignal.timeouton all SGP fetches - β AI prompt with clean history (strips automation/transfers)
- β Toggle switches in the O.S modal
- π Full rewrite β React + TypeScript + Manifest V3
- π Firebase-backed per-agent login system
- π O.S modal with automatic SGP form fill
- β‘ Categorized quick replies
- π€ Automatic attendance change detection
Built by Vituali for internal use at ATI Internet.
Available on the Chrome Web Store

