-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 1.0.0 Shortcut & click icon reveal
- Loading branch information
1 parent
53404f7
commit 5256d55
Showing
3 changed files
with
65 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//Reveal password when icon clicked | ||
chrome.browserAction.onClicked.addListener(function(tab) { | ||
revealPassword() | ||
}) | ||
|
||
chrome.commands.onCommand.addListener(function(command) { | ||
if(command === 'revealPassword'){ | ||
revealPassword() | ||
} | ||
}) | ||
|
||
function revealPassword(){ | ||
chrome.tabs.query({active: true, currentWindow: true}, (tabs)=>{ | ||
chrome.tabs.sendMessage( | ||
tabs[0].id, | ||
{msg: 'revealPassword'} | ||
) | ||
}) | ||
} |
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.msg === 'revealPassword'){ | ||
reveal() | ||
} | ||
}) | ||
|
||
function reveal(){ | ||
passwordFields = document.querySelectorAll('input[type="password"]') | ||
for(let i=0; i<passwordFields.length; i++){ | ||
passwordFields[i].setAttribute("type", "text") | ||
} | ||
} |
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,34 @@ | ||
{ | ||
"manifest_version": 2, | ||
|
||
"name": "Password Revealer with Keyboard Shortcut", | ||
"description": "View saved passwords with the click of a button", | ||
"version": "1.0.0", | ||
"version_name": "1.0.0", | ||
|
||
"browser_action": { | ||
// "default_icon": "assets/icons/icon.png", | ||
"default_title": "Alt+R (Reveal Password)" | ||
}, | ||
"permissions": [ | ||
"activeTab" | ||
], | ||
"background": { | ||
"scripts": [ | ||
"background.js" | ||
] | ||
}, | ||
"content_scripts": [{ | ||
"matches": ["<all_urls>"], | ||
"js": ["content-script.js"] | ||
} | ||
], | ||
"commands": { | ||
"revealPassword": { | ||
"suggested_key": { | ||
"default": "Alt+R" | ||
}, | ||
"description": "Reveal password in password fields" | ||
} | ||
} | ||
} |