EXTENSION FOR AUTOFILL FOR GOOGLE CHROME & FIREFOX

/* manifest.json */ { "manifest_version": 3, "name": "AutoFill Extension", "version": "1.0", "description": "Auto-fills form fields on a webpage.", "permissions": ["activeTab", "storage"], "action": { "default_popup": "popup.html", "default_icon": "icon.png" }, "content_scripts": [ { "matches": [""], "js": ["content.js"] } ] } AutoFill Extension

AutoFill Extension

// popup.js document.getElementById("fillFormBtn").addEventListener("click", function() { chrome.tabs.query({ active: true, currentWindow: true }, function(tabs) { chrome.scripting.executeScript({ target: { tabId: tabs[0].id }, function: autoFillForm }); }); }); function autoFillForm() { let data = { name: "John Doe", age: "30", email: "john.doe@example.com" }; document.querySelector("input[name='name']")?.value = data.name; document.querySelector("input[name='age']")?.value = data.age; document.querySelector("input[name='email']")?.value = data.email; } // content.js chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { if (request.action === "fillForm") { autoFillForm(); } }); // install.bat (Windows installer script) @echo off echo Installing AutoFill Extension... mkdir "%USERPROFILE%\AutoFillExtension" xcopy /E /I "%~dp0" "%USERPROFILE%\AutoFillExtension" echo Done! Now go to Chrome Extensions and Load Unpacked. pause
Next Post Previous Post
No Comment
Add Comment
comment url
//]]>