-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create manifest.json * Create content.js * Create popup.html * Create popup.js * Create background.js * Delete src/browser-extension directory * Create manifest.json * Create content.js * Create popup.html * Create popup.js * Create background.js * Update server.js
- Loading branch information
1 parent
8823daa
commit d8c33cf
Showing
6 changed files
with
85 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
chrome.runtime.onInstalled.addListener(() => { | ||
console.log("PassOP Autofill Extension installed."); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { | ||
if (request.action === "autofill") { | ||
const usernameField = document.querySelector("input[type='email'], input[type='text']"); | ||
const passwordField = document.querySelector("input[type='password']"); | ||
|
||
if (usernameField && passwordField) { | ||
usernameField.value = request.username; | ||
passwordField.value = request.password; | ||
sendResponse({ status: "filled" }); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"manifest_version": 3, | ||
"name": "PassOP AutoFill", | ||
"version": "1.0", | ||
"permissions": ["storage", "activeTab", "scripting"], | ||
"action": { | ||
"default_popup": "popup.html" | ||
}, | ||
"background": { | ||
"service_worker": "background.js" | ||
}, | ||
"content_scripts": [ | ||
{ | ||
"matches": ["<all_urls>"], | ||
"js": ["content.js"] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head><title>PassOP Autofill</title></head> | ||
<body> | ||
<input id="site" placeholder="Website URL" /> | ||
<button id="fetch">Fetch Credentials</button> | ||
|
||
<script src="popup.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
document.getElementById("fetch").addEventListener("click", () => { | ||
const site = document.getElementById("site").value; | ||
|
||
// Fetch credentials from backend (e.g., your API) | ||
fetch(`https://your-backend-url/api/credentials?site=${site}`) | ||
.then(response => response.json()) | ||
.then(data => { | ||
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => { | ||
chrome.tabs.sendMessage(tabs[0].id, { | ||
action: "autofill", | ||
username: data.username, | ||
password: data.password | ||
}); | ||
}); | ||
}); | ||
}); |