How jlp-009/meesho-supplier-autofill works
Purpose and Runtime
This repository is a browser extension that automates filling Meesho supplier catalog listing forms. It runs entirely in the browser: a background extension context, a popup UI, and a content script injected into Meesho pages. The extension stores reusable field profiles locally and can export/import them as JSON.
Key entry configuration: meesho-supplier-autofill/manifest.json.
Extension Entry Points
• Background lifecycle and extension-level messaging: meesho-supplier-autofill/background.js
• Popup interface for initiating autofill and managing saved profiles: meesho-supplier-autofill/popup.html, meesho-supplier-autofill/popup.js
• Page-side automation against the supplier listing DOM: meesho-supplier-autofill/content.js
• Shared form-targeting utilities: meesho-supplier-autofill/selector-utils.js
The manifest determines script injection, permissions, popup registration, and the separation between privileged extension APIs and page DOM access.
Popup and Profile Management
The popup is the user control plane. It collects or selects reusable listing-field profiles, triggers fill operations in the active Meesho tab, and supports JSON profile export/import.
meesho-supplier-autofill/popup.html provides the UI shell; meesho-supplier-autofill/popup.js owns UI events, persistence interactions, and commands sent to the content script.
Content-Side Form Automation
meesho-supplier-autofill/content.js is the primary execution engine. It observes or scans the Meesho listing page, locates catalog controls, applies saved values, and drives browser events needed for the page application to recognize changes. It covers ordinary fields, dropdowns, and size-variant inputs.
This is the main boundary with the external Meesho supplier UI: selectors and event behavior must tolerate DOM changes and dynamically rendered controls.
Selector and DOM Adaptation Layer
meesho-supplier-autofill/selector-utils.js centralizes DOM lookup and selector behavior used to identify fields reliably. It isolates site-specific targeting logic from higher-level profile replay, making it the likely maintenance point when Meesho changes its listing UI.
Related page styling or injected visual affordances are in meesho-supplier-autofill/styles.css.
Control and Data Flow
1. User opens the extension popup and selects, creates, imports, or exports a profile.
2. Popup code persists profile data through browser extension storage and sends an action/profile payload to the active tab.
3. The content script receives the request, scans the rendered supplier listing form, and resolves relevant controls through selector utilities.
4. It writes values and dispatches interaction events; dynamic dropdown and variant sections may require staged scanning/retry behavior.
5. Background code supports extension lifecycle or cross-context coordination where popup-to-tab messaging cannot directly complete the operation.
Infrastructure and Boundaries
No backend service is indicated. Material dependencies are browser extension APIs—especially tab messaging, local extension storage, and content-script injection—and the third-party Meesho supplier portal DOM. Static extension assets include meesho-supplier-autofill/icons and meesho-supplier-autofill/screenshots.
Main entry points: content.js Form Automation Engine · popup.js Popup Controller · manifest.json Extension Manifest · background.js Background Context
Components 11
Browser Extension
Privileged extension contexts and packaged entry configuration.
- Extension Manifest · Registers popup, permissions, background context, and content injection.
meesho-supplier-autofill/manifest.json - Popup UI · User control plane for autofill and profile management.
meesho-supplier-autofill/popup.html - Popup Controller · Manages profiles and sends active-tab actions.
meesho-supplier-autofill/popup.js - Local Profile Storage · Stores reusable profiles and imported JSON data.
- Background Context · Handles lifecycle and cross-context coordination.
meesho-supplier-autofill/background.js - Profile JSON · Portable saved-profile data.
Meesho Page Integration
Automation running against the supplier portal DOM.
- Form Automation Engine · Receives fill actions and drives the rendered listing form.
meesho-supplier-autofill/content.js - Selector Utilities · Centralizes Meesho-specific field lookup behavior.
meesho-supplier-autofill/selector-utils.js - Supplier Listing DOM · Dynamic external form controls, dropdowns, and variants.
- Browser Interaction Events · Events dispatched so the page application recognizes updates.
- Injected Styles · Visual affordances for page-side integration.
meesho-supplier-autofill/styles.css
Connections 16
- Extension Manifest → Popup UI: registers popup
- Extension Manifest → Background Context: starts
- Extension Manifest → Form Automation Engine: injects into Meesho
- Extension Manifest → Injected Styles: injects
- Popup UI → Popup Controller: user events
- Popup Controller → Local Profile Storage: save/load profiles
- Popup Controller → Profile JSON: import/export
- Popup Controller → Form Automation Engine: active-tab action + profile
- Popup Controller → Background Context: extension coordination
- Background Context → Form Automation Engine: cross-context messaging
- Form Automation Engine → Selector Utilities: resolves controls
- Selector Utilities → Supplier Listing DOM: queries dynamic fields
- Form Automation Engine → Supplier Listing DOM: writes profile values
- Form Automation Engine → Browser Interaction Events: dispatches changes
- Browser Interaction Events → Supplier Listing DOM: updates page state
- Injected Styles → Supplier Listing DOM: applies affordances