A Chrome extension that automatically identifies and fills out form fields on any webpage using a local Large Language Model.
This project consists of two main components:
- Spring Boot Server: A Java Spring Boot application that serves as the local LLM server.
- Chrome Extension: A Chrome extension that detects forms on webpages and communicates with the local server.
- Java 17 or higher
- Gradle
- Google Chrome browser
- Basic knowledge of Spring Boot and Chrome extensions
-
Clone this repository:
git clone https://github.com/yourusername/FormPilot.git cd FormPilot -
Build the Spring Boot application:
./gradlew build
-
Run the Spring Boot application:
./gradlew bootRun
The server will start on port 8080. You can verify it's running by visiting:
http://localhost:8080/api/form/health
-
Create icons for the extension as described in the chrome-extension/README.md file.
-
Open Google Chrome and navigate to:
chrome://extensions/ -
Enable "Developer mode" by toggling the switch in the top right corner.
-
Click "Load unpacked" and select the
chrome-extensiondirectory from this project. -
The extension should now be installed and visible in your Chrome toolbar.
A demo form is included in this project to help you test the Smart Form Filler extension:
-
Open the demo form in your browser:
file:///path/to/FormPilot/demo/demo-form.htmlReplace
path/to/FormPilotwith the actual path to your project directory. -
Alternatively, you can serve the demo form using a simple HTTP server:
# If you have Python installed cd FormPilot python -m http.server
Then visit
http://localhost:8000/demo/demo-form.htmlin your browser. -
With the Smart Form Filler extension installed and the local server running, the extension should automatically detect the form fields on the demo page.
-
You can manually trigger form filling in two ways:
- Click the extension icon in your Chrome toolbar
- Right-click on the page and select "Smart Form Filler" from the context menu, then choose "Fill Forms"
The demo form includes various field types to demonstrate the capabilities of the Smart Form Filler extension:
- Personal information (name, email, password, phone, date)
- Address information (street, city, state, zip, country)
- Account preferences (occupation, income, contact method, interests)
- Additional information (comments, checkboxes)
The Spring Boot server exposes a REST API that accepts form field data and returns appropriate values for each field. The server uses a rule-based approach to generate values based on field names, types, and labels.
Key components:
FormField: Model class representing a form fieldFormData: Model class representing a collection of form fieldsFormResponse: Model class representing the response with filled valuesFormFillerService: Service that generates values for form fieldsFormFillerController: REST controller that exposes the API endpoints
In a production environment, the server would integrate with a local LLM to generate more context-aware values.
The Chrome extension injects a content script into every webpage that detects forms and form fields. It sends the form field data to the background script, which communicates with the local server. The server returns appropriate values for each field, and the content script fills the form fields with these values.
Key components:
manifest.json: Configuration file for the extensioncontent.js: Content script that detects forms and fills form fieldsbackground.js: Background script that communicates with the local serverpopup.htmlandpopup.js: Popup UI for controlling the extension's behavior
POST /api/form/fill
Request body:
{
"url": "https://example.com/form",
"pageTitle": "Example Form",
"fields": [
{
"id": "email",
"name": "email",
"type": "email",
"label": "Email Address",
"placeholder": "Enter your email",
"required": true,
"value": ""
},
{
"id": "password",
"name": "password",
"type": "password",
"label": "Password",
"placeholder": "Enter your password",
"required": true,
"value": ""
}
]
}Response:
{
"filledValues": {
"email": "[email protected]",
"password": "SecurePassword123!"
},
"message": "Form fields filled successfully",
"success": true
}GET /api/form/health
Response:
Form Filler Service is running
- LLM Integration: Integrate with a local LLM to generate more context-aware values.
- User Data Storage: Allow users to save and load personal data for repeated use.
- Form Detection Improvements: Enhance form detection to handle more complex forms.
- Security Enhancements: Add authentication and encryption for communication between the extension and server.
- Custom Field Mappings: Allow users to define custom mappings for specific websites.
This project is licensed under the MIT License - see the LICENSE file for details.