# TypeLess β€” Auto Form Filler Browser extension for Chrome / Edge that saves web form data as profiles and auto-fills them with one click. ![TypeLess Banner](icons/icon.png) ## Screenshots ![Media Preview](Screenshot.png) --- ## ✨ Key Features ### πŸš€ Core Form Filling - ⚑ **One-Click Fill** β€” Fill an entire form instantly with a saved profile - πŸ“ **Unlimited Profiles** β€” Create and manage as many profiles as you need - 🎯 **Smart Field Matching** β€” Matches saved values to form fields by CSS selector, name, id, and label - πŸ”„ **Quick Switch** β€” Switch between profiles from the floating toolbar in one tap ### 🧠 Smart Fill - πŸ€– **Auto Data Generation** β€” Generates realistic test data (names, emails, phones, addresses, dates…) - ⚑ **Lightning Fill** β€” Click the bolt icon to instantly populate empty fields - 🎲 **Randomized Output** β€” Each Smart Fill produces unique data; ideal for QA and testing ### 🎯 Focus After Fill - Mark any field as the **Focus target** β€” cursor jumps to that field after applying a profile - A field can be marked Focus **without saving its value** (`focusOnly` mode) β€” useful for fields you always type manually (OTP, CAPTCHA, search) - Visual cue in the Save Profile dialog: πŸ”΅ blue border = value saved + focused; 🟠 orange border = focus only, value not saved ### 🌍 Multi-Language Support - πŸ‡ΊπŸ‡Έ English Β· πŸ‡»πŸ‡³ Vietnamese Β· πŸ‡¨πŸ‡³ Simplified Chinese Β· πŸ‡ΉπŸ‡Ό Traditional Chinese Β· πŸ‡―πŸ‡΅ Japanese Β· πŸ‡°πŸ‡· Korean - Language switches instantly across the entire UI - Language-specific fonts (WOFF2) for optimal CJK rendering ### πŸ› οΈ Advanced Tools - πŸ’Ύ **Save HTML** β€” Export the current page's rendered HTML for debugging - πŸ–±οΈ **Unlock Right-Click** β€” Remove `readonly` / `disabled` on locked fields; re-enable context menus - πŸ“Έ **Screenshot** β€” Full-page or visible-area capture; toolbar hidden automatically during capture - πŸ“± **Mobile Emulation** β€” Switch User-Agent to Android / iOS / macOS / Windows / Linux; simulates touch events - πŸ”„ **User-Agent Switcher** β€” Custom UA strings configurable from the Settings page ### πŸ’Ύ Data Management - πŸ“€ **Export** β€” Backup all profiles + settings to a JSON file - πŸ“₯ **Import** β€” Restore from backup; reports added / updated / skipped counts separately - πŸ“‹ **Copy / Paste** β€” Duplicate a profile to clipboard and paste it in another tab or device - πŸ—‘οΈ **Delete** β€” Remove individual profiles or clear all at once ### 🏒 Enterprise Deployment Pre-configure profiles for org-wide rollout via `default.json`: 1. Edit `default.json` β€” add profiles in the standard export format 2. Package and distribute the extension folder 3. Profiles auto-import on first install; users can still add their own *Designed for developer-mode / unpacked deployment. No internet required.* ### ⌨️ Keyboard Shortcuts | Shortcut | Action | |---|---| | `Ctrl+Shift+H` / `Cmd+Shift+H` | Toggle toolbar visibility | | *(configurable in Chrome settings)* | Apply last used profile | | *(configurable)* | Open Settings | | *(configurable)* | Full-page screenshot | | *(configurable)* | Visible-area screenshot | | *(configurable)* | Unlock right-click | | *(configurable)* | Save HTML | | *(configurable)* | Reset User-Agent | ### πŸ”’ Privacy & Security - πŸ” **100% Local Storage** β€” All data stays on your device (Chrome/Edge storage API) - πŸ›‘οΈ **AES-256-GCM Encryption** β€” Every profile is encrypted before writing to storage using a per-device key derived with PBKDF2-SHA256 (310,000 iterations). Raw field values are never stored in plaintext. - 🚫 **No Cloud, No Servers** β€” Nothing is ever transmitted externally - ⚠️ **Sensitive Field Warning** β€” When saving a profile on a login page (password/PIN/OTP fields detected), a warning banner appears with an option to exclude those fields. - πŸ›‘οΈ **Trusted Types API** β€” DOM XSS defense: a `typeless#html` TrustedTypePolicy is the sole entry-point for any `innerHTML` operation. User-controlled data is rendered via `DOMBuilder` (imperative DOM β€” no innerHTML). - πŸ”’ **No Tracking** β€” Zero analytics or usage monitoring - πŸ”’ **No Remote Code** β€” No `eval()`, no dynamic script loading; all logic runs locally --- ## πŸ“₯ Installation ### Chrome / Edge β€” Developer Mode 1. Download and unzip this repository 2. Open `chrome://extensions/` (Chrome) or `edge://extensions/` (Edge) 3. Enable **Developer mode** (top-right toggle) 4. Click **Load unpacked** β†’ select the `Typeless_secure` folder 5. The TypeLess toolbar appears at the bottom of every webpage automatically ### Enterprise Setup (Optional) 1. Open `default.json` inside the extension folder 2. Replace `"profiles": []` with your profile array (same format as an exported backup) 3. Distribute the modified folder; profiles load automatically on first install for every user --- ## πŸš€ Usage ### 1 Β· Save a Profile 1. Fill in a web form as usual 2. Click **Save** (πŸ’Ύ) on the toolbar 3. Choose which fields to save, optionally mark a Focus field, name the profile β†’ **Save Profile** ### 2 Β· Auto-Fill - **Toolbar:** Click a profile chip to fill instantly - **Popup:** Click the ▢️ Play button next to a profile name ### 3 Β· Smart Fill Click the ⚑ bolt icon β€” TypeLess detects field types (name, email, phone, address…) and fills them with generated data based on your personal info in **Settings β†’ Personal Info**. ### 4 Β· Manage Profiles - **Edit** field values, selectors, labels β€” **Settings β†’ Profiles** - **Export / Import** β€” **Settings β†’ Data Management** - **Copy** to clipboard; **Paste** in another tab or device --- ## πŸ› οΈ Project Structure ``` Typeless_fixed/ β”œβ”€β”€ manifest.json # Manifest V3 β€” permissions, commands, content scripts β”œβ”€β”€ background.js # Service worker β€” install handler, context menus, keyboard commands β”œβ”€β”€ content.js # Toolbar UI, Save Profile modal, form fill logic β”œβ”€β”€ dom-utils.js # Trusted Types policy + safe DOMBuilder (anti-XSS) β”œβ”€β”€ crypto-utils.js # AES-256-GCM profile encryption (Web Crypto API) β”œβ”€β”€ storage.js # StorageManager β€” transparent encrypt/decrypt on read-write β”œβ”€β”€ i18n.js # Internationalization β€” 6 languages, lazy-loaded JSON β”œβ”€β”€ enhanced-utils.js # Native value setter, FineUI / ExtJS ComboBox support β”œβ”€β”€ smart-fill.js # Field type detection and random data generation β”œβ”€β”€ popup.html / popup.js # Extension popup (profile list + tools) β”œβ”€β”€ options.html / options.js # Settings page (personal info, UA, data, profiles) β”œβ”€β”€ styles.css # Toolbar & modal styles (loaded inside Shadow DOM only) β”œβ”€β”€ screenshot.js # Full-page scroll-and-stitch screenshot logic β”œβ”€β”€ mobile-override.js # Touch event simulation for mobile emulation β”œβ”€β”€ user-agent.js # User-Agent switching via declarativeNetRequest β”œβ”€β”€ default.json # Enterprise default profiles configuration β”œβ”€β”€ demo-form.html # Local test form for development β”œβ”€β”€ privacy.html # Privacy Policy page β”œβ”€β”€ locales/ # Translation JSON (vi, zh-CN, zh-TW, ko, ja) β”œβ”€β”€ icons/ # SVG & PNG icons └── fonts/ # Be Vietnam Pro + language-specific web fonts ``` --- ## πŸ”’ Permissions Explained | Permission | Purpose | Privacy note | |---|---|---| | `storage` | Save profiles and preferences locally | 100% local, never synced to cloud | | `activeTab` | Read / write form fields on the current tab | Only on tabs you explicitly use | | `scripting` | Inject the floating toolbar | Only user-initiated | | `clipboardWrite` | Copy profile to clipboard | Only when you click Copy | | `clipboardRead` | Paste profile from clipboard | Only when you click Paste | | `contextMenus` | Right-click shortcuts (Smart Fill, Save, Unlock) | No data collection | | `declarativeNetRequest` | Override request headers for User-Agent switching | Only when UA switcher is active | | `declarativeNetRequestWithHostAccess` | Apply UA rules across all URLs | Only on demand | | `downloads` | Save screenshots and HTML exports | Only files you explicitly request | | `webNavigation` | Detect SPA URL changes to refresh profile list | No browsing history collected | | `` | Work on any website with a form | Activates only when you use it | **Security guarantees:** - βœ… No background scanning β€” extension is idle until you interact with it - βœ… No data mining β€” no browsing history, no page content collected - βœ… No remote connections β€” works fully offline - βœ… No over-reach β€” every permission is required for a specific stated feature --- ## πŸ› Troubleshooting **Q: Toolbar not showing?** A: Refresh the page (`F5`). A few sites block injected scripts β€” click the extension icon in the address bar to check for blocked-content warnings and grant permission. **Q: Fonts showing as squares on CJK pages?** A: TypeLess uses system fonts (Noto Sans CJK) for Chinese / Japanese / Korean to keep the extension size small. Install the relevant Noto Sans font for your OS. **Q: Fields not filling on a React / Vue / Angular form?** A: TypeLess dispatches both `Event('input')` and `Event('change')` via the native prototype setter to trigger framework reactivity. If a field still doesn't respond, try re-saving the profile after filling the form once manually. --- ## πŸ“ Changelog ### Version 1.0.5 #### πŸ” Security Hardening - πŸ›‘οΈ **Trusted Types API** (`dom-utils.js`): Registers a `typeless#html` TrustedTypePolicy that acts as the single chokepoint for all `innerHTML` assignments. The policy validates that input is either static internal markup, an extension-origin `` icon, or plain text β€” everything else throws immediately. In browsers without Trusted Types, the policy falls back gracefully. - πŸ—οΈ **`DOMBuilder`** (`dom-utils.js`): Imperative DOM builder (`el`, `text`, `icon`, `replace`) builds all user-data-driven elements via `textContent`/`.value`/`.title` β€” never `innerHTML`. The popup profile list (`loadProfiles`) fully migrated from template-literal `innerHTML` to `DOMBuilder`. - πŸ”’ **AES-256-GCM profile encryption** (`crypto-utils.js`): All profile data is encrypted with AES-256-GCM before writing to `chrome.storage.local`. Key derivation uses PBKDF2-SHA256 at 310,000 iterations (OWASP 2024) with a unique random salt per record. The 256-bit device key is generated once, stored locally, and never leaves the device. - πŸ”„ **Transparent storage migration**: `StorageManager.getProfiles()` automatically decrypts ciphertext entries and passes through legacy plaintext entries unchanged. Every write path (`saveProfile`, `renameProfile`, `deleteProfile`, `reorderProfiles`) encrypts before committing. - ⚠️ **Sensitive field warning + exclude toggle**: The Save Profile modal now detects password, PIN, and OTP fields (by `type="password"` and label heuristics). When found, a yellow warning banner appears at the footer of the modal. A checkbox lets the user exclude all sensitive fields from the saved profile in one click β€” they are never written to storage. ### Version 1.0.4 - πŸ› **Options page import dialog displayed raw HTML tags**: The `notify.imported` i18n string uses `
` for line breaks because the in-page toolbar notification renders it via `innerHTML`. When `options.js` passed the same string directly to `alert()` β€” which only renders plain text β€” users saw literal `πŸ“₯ Import done:
+3 added
β†Ί0 updated
⚠️0 skipped` instead of a multi-line message. Fixed: replace `
` with `\n` and strip all remaining HTML tags before calling `alert()`. - ✨ **Focus-only field β€” mark Focus without saving the value**: Previously the 🎯 Focus button had no effect unless the field's checkbox was ticked. Now any field can be the Focus target regardless of whether its value is saved. - βœ… Checked + 🎯 β†’ value **saved** and cursor **focused** after fill *(unchanged)* - ❌ Unchecked + 🎯 β†’ value **not saved**, cursor still **jumps** to the field after fill - Focus button shows an **orange** border when targeting an unchecked field, **blue** when the field is also saved - Toggling the checkbox immediately updates the button border color - `focusOnly: true` fields are stored in the profile with only their selector; `fillForm()` skips setting their value and only calls `.focus()` - πŸ› **`document.body.className` overwritten on every page**: `i18n.init()` called `document.body.className = \`lang-${lang}\`` unconditionally, wiping all existing classes on the host page's `` (e.g. `` became ``). Fixed: replaced with `classList.add()` / `classList.remove()` β€” only the extension's own `tl-lang-*` class is touched; all page classes are preserved. - πŸ”’ **All CSS classes and element IDs renamed to `tl-` prefix**: Every class used by the extension (`toolbar-btn`, `profile-chip`, `modal-header`, `field-item`, `drag-over`, `icon-btn`…) has been renamed with a `tl-` prefix (`tl-btn`, `tl-chip`, `tl-modal-header`, `tl-field-item`, `tl-drag-over`, `tl-icon-btn`…), including all shadow-internal button IDs. Shadow DOM already isolates the toolbar's CSS from the page, but the prefix eliminates any collision risk when page JavaScript queries the open shadow root and makes TypeLess elements immediately identifiable in DevTools. - πŸ› **`styles.css` injected globally into every page's light DOM**: The file was listed under `content_scripts β†’ css` in `manifest.json`, causing all 75+ bare class selectors (`.toolbar-btn`, `.profile-chip`, `.modal-header`, `.field-item`…) to be applied to every webpage β€” potentially breaking page layouts on load with no user interaction. Fixed: removed `styles.css` from `content_scripts β†’ css`; the stylesheet is already loaded inside the toolbar's Shadow DOM where it belongs. - πŸ› **`margin-bottom: 64px` applied to every page unconditionally on load**: `document.body.style.marginBottom = '64px'` was set immediately when the toolbar was created, before the async check for whether the toolbar was hidden. Every page got a 64 px bottom gap; if the toolbar was hidden the margin persisted until the next interaction. Fixed: check `StorageManager.getToolbarHidden()` first and only apply the margin when the toolbar is actually visible. - πŸ› **`createToolbar()` race condition β€” toolbar injected twice**: The `toolbarInjected` guard flag was checked before `await i18n.init()` but set after. Two concurrent calls (e.g. fast SPA navigation + content-script init) both passed the guard, both awaited, and both appended a toolbar to `document.body`. Fixed: `toolbarInjected = true` is now set synchronously right after the guard, before any `await`. - πŸ› **`loadProfiles()` used exact URL match instead of normalized URL**: Profiles are saved with `StorageManager.normalizeUrl()` (strips trailing slash, query string, common index filenames), but the toolbar filtered by `p.url === window.location.href`. A profile saved at `https://site.com/form/` would not appear on `https://site.com/form`. Fixed: both sides now use `StorageManager.normalizeUrl()`. - πŸ› **`const` inside `switch/case` without block braces β€” SyntaxError risk**: The `'radio'`, `'checkbox'`, and `default` branches in `smart-fill.js β†’ generateValue()` declared `const` variables directly in the case body without enclosing `{}`. This violates lexical scoping rules β€” strict-mode engines may throw `SyntaxError`; others hoist declarations unexpectedly across sibling cases. Fixed: all affected cases now use `{ }` block syntax. **UI / UX** - 🎨 **Toolbar redesign β€” compact layout**: Height reduced from ~70 px to 64 px (30 px header + 34 px chip row). Profile list now renders as a horizontally scrollable row of single-line chips in `[N] Name Γ—` format, replacing the previous two-line card layout. - πŸ”€ **Drag-and-drop profile reorder** across all three surfaces β€” toolbar chips (left/right), popup list (up/down), options page list (up/down). Order is persisted to storage immediately after each drop. - πŸ—‘οΈ **Inline delete in Options β†’ Profiles**: Each card now has an inline `Γ—` delete button. A new **Delete All** button clears all profiles after confirmation. - 🌐 **Toolbar title updates on language change**: `refreshToolbarUI()` was missing the `.tl-title-text` element update β€” now all toolbar text switches language together. **Bug fixes** - πŸ› Options page not opening on first install β€” `openOptionsPage()` silently fails in service worker context right after installation; replaced with `chrome.tabs.create({ url: chrome.runtime.getURL('options.html') })`. - πŸ› False "restricted page" warning shown on the extension's own Options page β€” `chrome-extension://` was blocked globally; now only other extensions' pages are blocked, not the extension's own. - πŸ› `file://` pages incorrectly listed as restricted β€” local HTML files are now supported when file access is granted to the extension. - πŸ› "Extension context invalidated" console errors after extension reload β€” `_extAlive()` guard + `try/catch` added so stale content scripts fail silently. - πŸ”’ Iframe relay nonce replaced with `event.source` hierarchy validation β€” the per-frame nonce approach broke all iframe communication because each frame generates its own nonce independently. **New storage API** - βž• `StorageManager.reorderProfiles(orderedIds)` β€” persist drag-and-drop order by profile ID array - βž• `StorageManager.clearAllProfiles()` β€” wipe all profiles in one call - πŸ”’ Background `onMessage` listener validates `sender.id === chrome.runtime.id`, rejecting messages from external pages. - πŸ›‘οΈ JSON import rejects files larger than 5 MB to prevent memory exhaustion. - 🏒 Enterprise `default.json` β€” profiles are automatically imported on first install. - πŸ› Removed duplicate `toggleToolbar` handler that used incorrect `style.display` check instead of `classList`. - πŸ–ΌοΈ Fixed SVG icons not loading in content script context β€” replaced individual `web_accessible_resources` entries with `icons/*` wildcard. - 🎨 Fixed Focus button icon rendered as raw HTML text in CSS `content:` property. - πŸ” Fixed profile search `placeholder` attribute containing a literal `` tag. - πŸ”’ XSS hardening: in-page notification changed from `innerHTML` to `textContent` assignment. - ✏️ Inline profile rename from the popup β€” pencil button edits the name in place; no need to delete and recreate. ### Version 1.0.3 - πŸŽ›οΈ **FineUI / ComboBox support**: detects inputs paired with a hidden `$Value` field (FineUI DDL, ExtJS, custom combo-wrap patterns). Saves both display text and the hidden code value; restores both on fill via a three-tier lookup (component API β†’ DOM `
  • ` click β†’ direct hidden input assignment). - πŸ“Έ **Screenshot**: toolbar automatically hides before capture and restores after β€” no toolbar overlap in screenshots. - πŸ”’ **Extension context guard** `_extAlive()`: prevents "Extension context invalidated" errors on stale content scripts after extension update. - 🎯 **Focus After Fill**: `focusAfterFill` field property moves the cursor (with caret at end) to a designated field after applying a profile. - πŸ“Š **Profile Manager in Settings**: view, search, and edit all profiles and their individual fields from the Options page without opening the popup. - πŸ“€ **Export Format v1.2**: JSON export includes `_version`, `_exportedAt`, `_count` metadata and supports `displayText` and `focusAfterFill` field properties for full round-trip fidelity. - πŸ“₯ **Improved import result**: reports **added / updated / skipped** counts separately. - πŸ”’ **Persistent profile counter**: auto-increment counter for default profile names persisted per calendar day to prevent name collisions across sessions. - ♻️ **`StorageManager.saveProfile()` API change**: returns `{ success, isNew }` instead of a plain boolean, enabling callers to distinguish new saves from overwrites. ### Version 1.0.2 - πŸ“± **Mobile Emulation**: accurate Android / iOS simulation β€” User-Agent string, `navigator.platform`, touch event injection, Client Hints (`Sec-CH-UA-*` headers). - πŸ“Έ **Screenshot**: full-page scroll-and-stitch capture and visible-area capture, both saved directly to Downloads. ### Version 1.0.1 - 🌍 Added 4 languages: Simplified Chinese πŸ‡¨πŸ‡³, Traditional Chinese πŸ‡ΉπŸ‡Ό, Japanese πŸ‡―πŸ‡΅, Korean πŸ‡°πŸ‡·. - πŸ’Ύ **Save HTML** β€” export the current page's fully rendered DOM as a local HTML file. - 🎨 UI updates: button borders, bold text, new icon set. - πŸ› Fixed font loading for CJK languages; fixed translation key fallback issues. --- ## πŸ‘¨β€πŸ’» Author **TRONG.PRO** ## πŸ“„ License MIT License