Upgraded deprecated API calls, removed unnecessary images, upgraded jquery
|
|
@ -1,3 +1,10 @@
|
|||
// This quick method Copyright (c) 2016 David Rousset
|
||||
window.browser = (function () {
|
||||
return window.msBrowser ||
|
||||
window.browser ||
|
||||
window.chrome;
|
||||
})();
|
||||
|
||||
var browserAction = {};
|
||||
|
||||
var BLINK_TIMEOUT_DEFAULT = 7500;
|
||||
|
|
@ -14,13 +21,13 @@ browserAction.show = function(callback, tab) {
|
|||
data = page.tabs[tab.id].stack[page.tabs[tab.id].stack.length - 1];
|
||||
}
|
||||
|
||||
chrome.browserAction.setIcon({
|
||||
browser.browserAction.setIcon({
|
||||
tabId: tab.id,
|
||||
path: "/icons/19x19/" + browserAction.generateIconName(data.iconType, data.icon)
|
||||
});
|
||||
|
||||
if(data.popup) {
|
||||
chrome.browserAction.setPopup({
|
||||
browser.browserAction.setPopup({
|
||||
tabId: tab.id,
|
||||
popup: "popups/" + data.popup
|
||||
});
|
||||
|
|
@ -57,7 +64,7 @@ browserAction.update = function(interval) {
|
|||
data.intervalIcon.index = 0;
|
||||
}
|
||||
|
||||
chrome.browserAction.setIcon({
|
||||
browser.browserAction.setIcon({
|
||||
tabId: page.currentTabId,
|
||||
path: "/icons/19x19/" + browserAction.generateIconName(null, data.intervalIcon.icons[data.intervalIcon.index])
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,3 +1,10 @@
|
|||
// This quick method Copyright (c) 2016 David Rousset
|
||||
window.browser = (function () {
|
||||
return window.msBrowser ||
|
||||
window.browser ||
|
||||
window.chrome;
|
||||
})();
|
||||
|
||||
var event = {};
|
||||
|
||||
|
||||
|
|
@ -43,8 +50,8 @@ event.invoke = function(handler, callback, senderTabId, args, secondTime) {
|
|||
// remove information from no longer existing tabs
|
||||
page.removePageInformationFromNotExistingTabs();
|
||||
|
||||
chrome.tabs.get(senderTabId, function(tab) {
|
||||
//chrome.tabs.query({"active": true, "windowId": chrome.windows.WINDOW_ID_CURRENT}, function(tabs) {
|
||||
browser.tabs.get(senderTabId, function(tab) {
|
||||
//browser.tabs.query({"active": true, "windowId": browser.windows.WINDOW_ID_CURRENT}, function(tabs) {
|
||||
//if (tabs.length === 0)
|
||||
// return; // For example: only the background devtools or a popup are opened
|
||||
//var tab = tabs[0];
|
||||
|
|
|
|||
|
|
@ -49,8 +49,8 @@ httpAuth.loginOrShowCredentials = function(logins) {
|
|||
if(page.settings.autoFillAndSend) {
|
||||
httpAuth.callback({
|
||||
authCredentials: {
|
||||
username: logins[0].Login,
|
||||
password: logins[0].Password
|
||||
username: logins[0].login,
|
||||
password: logins[0].password
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,9 +11,15 @@ keepass.changePublicKeys(null, function(pkRes) {
|
|||
keepass.getDatabaseHash(function(gdRes) {}, null);
|
||||
});
|
||||
|
||||
// This quick method Copyright (c) 2016 David Rousset
|
||||
window.browser = (function () {
|
||||
return window.msBrowser ||
|
||||
window.browser ||
|
||||
window.chrome;
|
||||
})();
|
||||
|
||||
// set initial tab-ID
|
||||
chrome.tabs.query({"active": true, "windowId": chrome.windows.WINDOW_ID_CURRENT}, function(tabs) {
|
||||
browser.tabs.query({"active": true, "windowId": browser.windows.WINDOW_ID_CURRENT}, function(tabs) {
|
||||
if (tabs.length === 0)
|
||||
return; // For example: only the background devtools or a popup are opened
|
||||
page.currentTabId = tabs[0].id;
|
||||
|
|
@ -27,9 +33,9 @@ var _interval = 250;
|
|||
* functions if tab is created in foreground
|
||||
* @param {object} tab
|
||||
*/
|
||||
chrome.tabs.onCreated.addListener(function(tab) {
|
||||
browser.tabs.onCreated.addListener(function(tab) {
|
||||
if(tab.id > 0) {
|
||||
//console.log("chrome.tabs.onCreated(" + tab.id+ ")");
|
||||
//console.log("browser.tabs.onCreated(" + tab.id+ ")");
|
||||
if(tab.selected) {
|
||||
page.currentTabId = tab.id;
|
||||
event.invoke(page.switchTab, null, tab.id, []);
|
||||
|
|
@ -42,7 +48,7 @@ chrome.tabs.onCreated.addListener(function(tab) {
|
|||
* @param {integer} tabId
|
||||
* @param {object} removeInfo
|
||||
*/
|
||||
chrome.tabs.onRemoved.addListener(function(tabId, removeInfo) {
|
||||
browser.tabs.onRemoved.addListener(function(tabId, removeInfo) {
|
||||
delete page.tabs[tabId];
|
||||
if(page.currentTabId == tabId) {
|
||||
page.currentTabId = -1;
|
||||
|
|
@ -54,12 +60,12 @@ chrome.tabs.onRemoved.addListener(function(tabId, removeInfo) {
|
|||
* Invoke functions to retrieve credentials for focused tab
|
||||
* @param {object} activeInfo
|
||||
*/
|
||||
chrome.tabs.onActivated.addListener(function(activeInfo) {
|
||||
browser.tabs.onActivated.addListener(function(activeInfo) {
|
||||
// remove possible credentials from old tab information
|
||||
page.clearCredentials(page.currentTabId, true);
|
||||
browserAction.removeRememberPopup(null, {"id": page.currentTabId}, true);
|
||||
|
||||
chrome.tabs.get(activeInfo.tabId, function(info) {
|
||||
browser.tabs.get(activeInfo.tabId, function(info) {
|
||||
//console.log(info.id + ": " + info.url);
|
||||
if(info && info.id) {
|
||||
page.currentTabId = info.id;
|
||||
|
|
@ -76,7 +82,7 @@ chrome.tabs.onActivated.addListener(function(activeInfo) {
|
|||
* @param {integer} tabId
|
||||
* @param {object} changeInfo
|
||||
*/
|
||||
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
|
||||
browser.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
|
||||
if(changeInfo.status == "complete") {
|
||||
event.invoke(browserAction.removeRememberPopup, null, tabId, []);
|
||||
}
|
||||
|
|
@ -86,24 +92,24 @@ chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
|
|||
/**
|
||||
* Retrieve Credentials and try auto-login for HTTPAuth requests
|
||||
*/
|
||||
chrome.webRequest.onAuthRequired.addListener(httpAuth.handleRequest,
|
||||
browser.webRequest.onAuthRequired.addListener(httpAuth.handleRequest,
|
||||
{ urls: ["<all_urls>"] }, ["asyncBlocking"]
|
||||
);
|
||||
|
||||
/**
|
||||
* Interaction between background-script and front-script
|
||||
*/
|
||||
chrome.extension.onMessage.addListener(event.onMessage);
|
||||
browser.runtime.onMessage.addListener(event.onMessage);
|
||||
|
||||
|
||||
/**
|
||||
* Add context menu entry for filling in username + password
|
||||
*/
|
||||
chrome.contextMenus.create({
|
||||
browser.contextMenus.create({
|
||||
"title": "Fill &User + Pass",
|
||||
"contexts": [ "editable" ],
|
||||
"onclick": function(info, tab) {
|
||||
chrome.tabs.sendMessage(tab.id, {
|
||||
browser.tabs.sendMessage(tab.id, {
|
||||
action: "fill_user_pass"
|
||||
});
|
||||
}
|
||||
|
|
@ -112,11 +118,11 @@ chrome.contextMenus.create({
|
|||
/**
|
||||
* Add context menu entry for filling in only password which matches for given username
|
||||
*/
|
||||
chrome.contextMenus.create({
|
||||
browser.contextMenus.create({
|
||||
"title": "Fill &Pass Only",
|
||||
"contexts": [ "editable" ],
|
||||
"onclick": function(info, tab) {
|
||||
chrome.tabs.sendMessage(tab.id, {
|
||||
browser.tabs.sendMessage(tab.id, {
|
||||
action: "fill_pass_only"
|
||||
});
|
||||
}
|
||||
|
|
@ -125,11 +131,11 @@ chrome.contextMenus.create({
|
|||
/**
|
||||
* Add context menu entry for creating icon for generate-password dialog
|
||||
*/
|
||||
chrome.contextMenus.create({
|
||||
browser.contextMenus.create({
|
||||
"title": "Show Password &Generator Icons",
|
||||
"contexts": [ "editable" ],
|
||||
"onclick": function(info, tab) {
|
||||
chrome.tabs.sendMessage(tab.id, {
|
||||
browser.tabs.sendMessage(tab.id, {
|
||||
action: "activate_password_generator"
|
||||
});
|
||||
}
|
||||
|
|
@ -138,11 +144,11 @@ chrome.contextMenus.create({
|
|||
/**
|
||||
* Add context menu entry for creating icon for generate-password dialog
|
||||
*/
|
||||
chrome.contextMenus.create({
|
||||
browser.contextMenus.create({
|
||||
"title": "&Save credentials",
|
||||
"contexts": [ "editable" ],
|
||||
"onclick": function(info, tab) {
|
||||
chrome.tabs.sendMessage(tab.id, {
|
||||
browser.tabs.sendMessage(tab.id, {
|
||||
action: "remember_credentials"
|
||||
});
|
||||
}
|
||||
|
|
@ -151,19 +157,19 @@ chrome.contextMenus.create({
|
|||
/**
|
||||
* Listen for keyboard shortcuts specified by user
|
||||
*/
|
||||
chrome.commands.onCommand.addListener(function(command) {
|
||||
browser.commands.onCommand.addListener(function(command) {
|
||||
if (command === "fill-username-password") {
|
||||
chrome.tabs.query({ active: true, currentWindow: true }, function(tabs) {
|
||||
browser.tabs.query({ active: true, currentWindow: true }, function(tabs) {
|
||||
if (tabs.length) {
|
||||
chrome.tabs.sendMessage(tabs[0].id, { action: "fill_user_pass" });
|
||||
browser.tabs.sendMessage(tabs[0].id, { action: "fill_user_pass" });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (command === "fill-password") {
|
||||
chrome.tabs.query({ active: true, currentWindow: true }, function(tabs) {
|
||||
browser.tabs.query({ active: true, currentWindow: true }, function(tabs) {
|
||||
if (tabs.length) {
|
||||
chrome.tabs.sendMessage(tabs[0].id, { action: "fill_pass_only" });
|
||||
browser.tabs.sendMessage(tabs[0].id, { action: "fill_pass_only" });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,12 @@ keepass.keyRing = (typeof(localStorage.keyRing) == 'undefined') ? {} : JSON.pars
|
|||
keepass.keyId = "chromekeepassxc-cryptokey-name";
|
||||
keepass.keyBody = "chromekeepassxc-key";
|
||||
|
||||
// This quick method Copyright (c) 2016 David Rousset
|
||||
window.browser = (function () {
|
||||
return window.msBrowser ||
|
||||
window.browser ||
|
||||
window.chrome;
|
||||
})();
|
||||
|
||||
keepass.addCredentials = function(callback, tab, username, password, url) {
|
||||
keepass.updateCredentials(callback, tab, null, username, password, url);
|
||||
|
|
@ -257,21 +263,22 @@ keepass.generatePassword = function (callback, tab, forceCallback) {
|
|||
}
|
||||
|
||||
keepass.copyPassword = function(callback, tab, password) {
|
||||
var bg = chrome.extension.getBackgroundPage();
|
||||
var c2c = bg.document.getElementById("copy2clipboard");
|
||||
if (!c2c) {
|
||||
var input = document.createElement('input');
|
||||
input.type = "text";
|
||||
input.id = "copy2clipboard";
|
||||
bg.document.getElementsByTagName('body')[0].appendChild(input);
|
||||
c2c = bg.document.getElementById("copy2clipboard");
|
||||
}
|
||||
browser.runtime.getBackgroundPage(function(bg) {
|
||||
var c2c = bg.document.getElementById("copy2clipboard");
|
||||
if (!c2c) {
|
||||
var input = document.createElement('input');
|
||||
input.type = "text";
|
||||
input.id = "copy2clipboard";
|
||||
bg.document.getElementsByTagName('body')[0].appendChild(input);
|
||||
c2c = bg.document.getElementById("copy2clipboard");
|
||||
}
|
||||
|
||||
c2c.value = password;
|
||||
c2c.select();
|
||||
document.execCommand("copy");
|
||||
c2c.value = "";
|
||||
callback(true);
|
||||
c2c.value = password;
|
||||
c2c.select();
|
||||
document.execCommand("copy");
|
||||
c2c.value = "";
|
||||
callback(true);
|
||||
});
|
||||
}
|
||||
|
||||
keepass.associate = function(callback, tab) {
|
||||
|
|
@ -447,7 +454,7 @@ keepass.getDatabaseHash = function (callback, tab, triggerUnlock) {
|
|||
keepass.changePublicKeys(tab, null);
|
||||
}
|
||||
|
||||
message = { "action": "get-databasehash" };
|
||||
var message = { "action": "get-databasehash" };
|
||||
keepass.callbackOnId(keepass.nativePort.onMessage, "get-databasehash", function(response) {
|
||||
if (response.hash)
|
||||
{
|
||||
|
|
@ -495,7 +502,7 @@ keepass.changePublicKeys = function(tab, callback) {
|
|||
var nonce = nacl.randomBytes(keepass.keySize);
|
||||
nonce = keepass.b64e(nonce);
|
||||
|
||||
message = {
|
||||
var message = {
|
||||
"action": "change-public-keys",
|
||||
"publicKey": key,
|
||||
"nonce": nonce
|
||||
|
|
@ -671,7 +678,7 @@ keepass.onNativeMessage = function (response) {
|
|||
}
|
||||
|
||||
function onDisconnected() {
|
||||
console.log("Failed to connect: " + chrome.runtime.lastError.message);
|
||||
console.log("Failed to connect: " + browser.runtime.lastError.message);
|
||||
keepass.nativePort = null;
|
||||
keepass.isConnected = false;
|
||||
keepass.isDatabaseClosed = true;
|
||||
|
|
@ -680,7 +687,7 @@ function onDisconnected() {
|
|||
|
||||
keepass.nativeConnect = function() {
|
||||
console.log("Connecting to native messaging host " + keepass.nativeHostName)
|
||||
keepass.nativePort = chrome.runtime.connectNative(keepass.nativeHostName);
|
||||
keepass.nativePort = browser.runtime.connectNative(keepass.nativeHostName);
|
||||
keepass.nativePort.onMessage.addListener(keepass.onNativeMessage);
|
||||
keepass.nativePort.onDisconnect.addListener(onDisconnected);
|
||||
keepass.isConnected = true;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,10 @@
|
|||
// This quick method Copyright (c) 2016 David Rousset
|
||||
window.browser = (function () {
|
||||
return window.msBrowser ||
|
||||
window.browser ||
|
||||
window.chrome;
|
||||
})();
|
||||
|
||||
var page = {};
|
||||
|
||||
// special information for every tab
|
||||
|
|
@ -31,7 +38,7 @@ page.initSettings = function() {
|
|||
}
|
||||
|
||||
page.initOpenedTabs = function() {
|
||||
chrome.tabs.query({}, function(tabs) {
|
||||
browser.tabs.query({}, function(tabs) {
|
||||
for(var i = 0; i < tabs.length; i++) {
|
||||
page.createTabEntry(tabs[i].id);
|
||||
}
|
||||
|
|
@ -47,7 +54,7 @@ page.isValidProtocol = function(url) {
|
|||
page.switchTab = function(callback, tab) {
|
||||
browserAction.showDefault(null, tab);
|
||||
|
||||
chrome.tabs.sendMessage(tab.id, {action: "activated_tab"});
|
||||
browser.tabs.sendMessage(tab.id, {action: "activated_tab"});
|
||||
}
|
||||
|
||||
page.clearCredentials = function(tabId, complete) {
|
||||
|
|
@ -61,7 +68,7 @@ page.clearCredentials = function(tabId, complete) {
|
|||
if(complete) {
|
||||
page.tabs[tabId].loginList = [];
|
||||
|
||||
chrome.tabs.sendMessage(tabId, {
|
||||
browser.tabs.sendMessage(tabId, {
|
||||
action: "clear_credentials"
|
||||
});
|
||||
}
|
||||
|
|
@ -79,7 +86,7 @@ page.createTabEntry = function(tabId) {
|
|||
page.removePageInformationFromNotExistingTabs = function() {
|
||||
var rand = Math.floor(Math.random()*1001);
|
||||
if(rand == 28) {
|
||||
chrome.tabs.query({}, function(tabs) {
|
||||
browser.tabs.query({}, function(tabs) {
|
||||
var $tabIds = {};
|
||||
var $infoIds = Object.keys(page.tabs);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
font-family: Verdana, Arial, sans-serif !important;
|
||||
color: #222222 !important;
|
||||
}
|
||||
.cip-ui-dialog-titlebar-close {
|
||||
.ui-dialog-titlebar-close {
|
||||
visibility: hidden !important;
|
||||
}
|
||||
.cip-ui-widget-overlay {
|
||||
|
|
@ -169,4 +169,38 @@
|
|||
border: 2px solid deepskyblue;
|
||||
color: #efefef;
|
||||
background-color:rgba(30,144,255,0.4);
|
||||
}
|
||||
|
||||
|
||||
.b2c-input-append {
|
||||
display: inline-block;
|
||||
margin-bottom: 10px;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.b2c-input-append input,
|
||||
.b2c-input-append select,
|
||||
.b2c-input-append .b2c-uneditable-input,
|
||||
.b2c-input-append .b2c-dropdown-menu,
|
||||
.b2c-input-append .b2c-popover {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.b2c-input-append input,
|
||||
.b2c-input-append select,
|
||||
.b2c-input-append .b2c-uneditable-input {
|
||||
position: relative;
|
||||
margin-bottom: 0;
|
||||
*margin-left: 0;
|
||||
vertical-align: top;
|
||||
-webkit-border-radius: 0 4px 4px 0;
|
||||
-moz-border-radius: 0 4px 4px 0;
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
|
||||
.b2c-input-append input:focus,
|
||||
.b2c-input-append select:focus,
|
||||
.b2c-input-append .b2c-b2c-uneditable-input:focus {
|
||||
z-index: 2;
|
||||
}
|
||||
|
|
@ -1,7 +1,14 @@
|
|||
// This quick method Copyright (c) 2016 David Rousset
|
||||
window.browser = (function () {
|
||||
return window.msBrowser ||
|
||||
window.browser ||
|
||||
window.chrome;
|
||||
})();
|
||||
|
||||
// contains already called method names
|
||||
var _called = {};
|
||||
|
||||
chrome.extension.onMessage.addListener(function(req, sender, callback) {
|
||||
browser.runtime.onMessage.addListener(function(req, sender, callback) {
|
||||
if ('action' in req) {
|
||||
if(req.action == "fill_user_pass_with_specific_login") {
|
||||
if(cip.credentials[req.id]) {
|
||||
|
|
@ -48,7 +55,7 @@ chrome.extension.onMessage.addListener(function(req, sender, callback) {
|
|||
cipEvents.triggerActivatedTab();
|
||||
}
|
||||
else if (req.action == "redetect_fields") {
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
"action": "get_settings",
|
||||
}, function(response) {
|
||||
cip.settings = response.data;
|
||||
|
|
@ -76,7 +83,7 @@ var cipAutocomplete = {};
|
|||
cipAutocomplete.elements = [];
|
||||
|
||||
cipAutocomplete.init = function(field) {
|
||||
if(field.hasClass("cip-ui-autocomplete-input")) {
|
||||
if(field.hasClass("ui-autocomplete-input")) {
|
||||
//_f(credentialInputs[i].username).autocomplete("source", autocompleteSource);
|
||||
field.autocomplete("destroy");
|
||||
}
|
||||
|
|
@ -101,7 +108,7 @@ cipAutocomplete.onClick = function() {
|
|||
cipAutocomplete.onOpen = function(event, ui) {
|
||||
// NOT BEAUTIFUL!
|
||||
// modifies ALL ui-autocomplete menus of class .cip-ui-menu
|
||||
jQuery("ul.cip-ui-autocomplete.cip-ui-menu").css("z-index", 2147483636);
|
||||
jQuery("ul.ui-autocomplete.ui-menu").css("z-index", 2147483636);
|
||||
}
|
||||
|
||||
cipAutocomplete.onSource = function (request, callback) {
|
||||
|
|
@ -211,7 +218,7 @@ cipPassword.createDialog = function() {
|
|||
.css("float", "left")
|
||||
.click(function(e) {
|
||||
e.preventDefault();
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: "generate_password"
|
||||
}, cipPassword.callbackGeneratedPassword);
|
||||
});
|
||||
|
|
@ -226,7 +233,7 @@ cipPassword.createDialog = function() {
|
|||
.click(function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: "copy_password",
|
||||
args: [jQuery("input#cip-genpw-textfield-password").val()]
|
||||
}, cipPassword.callbackPasswordCopied);
|
||||
|
|
@ -296,7 +303,7 @@ cipPassword.createDialog = function() {
|
|||
}
|
||||
|
||||
// copy password to clipboard
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: "copy_password",
|
||||
args: [$password]
|
||||
}, cipPassword.callbackPasswordCopied);
|
||||
|
|
@ -314,7 +321,7 @@ cipPassword.createDialog = function() {
|
|||
minWidth: 340,
|
||||
title: "Password Generator",
|
||||
open: function(event, ui) {
|
||||
jQuery(".cip-ui-widget-overlay").click(function() {
|
||||
jQuery(".ui-widget-overlay").click(function() {
|
||||
jQuery("#cip-genpw-dialog:first").dialog("close");
|
||||
});
|
||||
|
||||
|
|
@ -426,7 +433,7 @@ cipPassword.callbackGeneratedPassword = function(entries) {
|
|||
}
|
||||
|
||||
cipPassword.onRequestPassword = function() {
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
'action': 'generate_password'
|
||||
}, cipPassword.callbackGeneratedPassword);
|
||||
}
|
||||
|
|
@ -612,7 +619,7 @@ cipDefine.initDescription = function() {
|
|||
"fields": fieldIds
|
||||
};
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'save_settings',
|
||||
args: [cip.settings]
|
||||
});
|
||||
|
|
@ -638,12 +645,12 @@ cipDefine.initDescription = function() {
|
|||
.click(function(e) {
|
||||
delete cip.settings["defined-credential-fields"][document.location.origin];
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'save_settings',
|
||||
args: [cip.settings]
|
||||
});
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'load_settings'
|
||||
});
|
||||
|
||||
|
|
@ -1096,7 +1103,7 @@ cipFields.useDefinedCredentialFields = function() {
|
|||
|
||||
var cip = {};
|
||||
|
||||
// settings of chromeIPass
|
||||
// settings of chromeKeePassXC
|
||||
cip.settings = {};
|
||||
// username field which will be set on focus
|
||||
cip.u = null;
|
||||
|
|
@ -1114,7 +1121,7 @@ jQuery(function() {
|
|||
});
|
||||
|
||||
cip.init = function() {
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
"action": "get_settings",
|
||||
}, function(response) {
|
||||
cip.settings = response.data;
|
||||
|
|
@ -1139,7 +1146,7 @@ cip.initCredentialFields = function(forceCall) {
|
|||
cipFields.prepareCombinations(cipFields.combinations);
|
||||
|
||||
if (cipFields.combinations.length == 0) {
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
'action': 'show_default_browseraction'
|
||||
});
|
||||
return;
|
||||
|
|
@ -1149,7 +1156,7 @@ cip.initCredentialFields = function(forceCall) {
|
|||
cip.submitUrl = cip.getFormActionUrl(cipFields.combinations[0]);
|
||||
|
||||
if (cip.settings.autoRetrieveCredentials) {
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
'action': 'retrieve_credentials',
|
||||
'args': [ cip.url, cip.submitUrl ]
|
||||
}, cip.retrieveCredentialsCallback);
|
||||
|
|
@ -1170,7 +1177,7 @@ cip.initPasswordGenerator = function(inputs) {
|
|||
|
||||
cip.receiveCredentialsIfNecessary = function () {
|
||||
if (cip.credentials.length == 0) {
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
'action': 'retrieve_credentials',
|
||||
'args': [ cip.url, cip.submitUrl ]
|
||||
}, cip.retrieveCredentialsCallback);
|
||||
|
|
@ -1215,7 +1222,7 @@ cip.prepareFieldsForCredentials = function(autoFillInForSingle) {
|
|||
}
|
||||
|
||||
// generate popup-list of usernames + descriptions
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
'action': 'popup_login',
|
||||
'args': [[cip.credentials[0].login + " (" + cip.credentials[0].name + ")"]]
|
||||
});
|
||||
|
|
@ -1243,7 +1250,7 @@ cip.preparePageForMultipleCredentials = function(credentials) {
|
|||
}
|
||||
|
||||
// generate popup-list of usernames + descriptions
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
'action': 'popup_login',
|
||||
'args': [usernames]
|
||||
});
|
||||
|
|
@ -1311,7 +1318,7 @@ cip.fillInCredentials = function(combination, onlyPassword, suppressWarnings) {
|
|||
cip.url = document.location.origin;
|
||||
cip.submitUrl = action;
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
'action': 'retrieve_credentials',
|
||||
'args': [ cip.url, cip.submitUrl, false, true ]
|
||||
}, function(credentials) {
|
||||
|
|
@ -1365,7 +1372,7 @@ cip.fillInFromActiveElementPassOnly = function(suppressWarnings) {
|
|||
|
||||
if (!_f(combination.password)) {
|
||||
var message = "Unable to find a password field";
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'alert',
|
||||
args: [message]
|
||||
});
|
||||
|
|
@ -1433,7 +1440,7 @@ cip.fillIn = function(combination, onlyPassword, suppressWarnings) {
|
|||
// no credentials available
|
||||
if (cip.credentials.length == 0 && !suppressWarnings) {
|
||||
var message = "No logins found.";
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'alert',
|
||||
args: [message]
|
||||
});
|
||||
|
|
@ -1466,7 +1473,7 @@ cip.fillIn = function(combination, onlyPassword, suppressWarnings) {
|
|||
if (!filledIn) {
|
||||
if (!suppressWarnings) {
|
||||
var message = "Error #101\nCannot find fields to fill in.";
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'alert',
|
||||
args: [message]
|
||||
});
|
||||
|
|
@ -1496,7 +1503,7 @@ cip.fillIn = function(combination, onlyPassword, suppressWarnings) {
|
|||
if (!filledIn) {
|
||||
if (!suppressWarnings) {
|
||||
var message = "Error #102\nCannot find fields to fill in.";
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'alert',
|
||||
args: [message]
|
||||
});
|
||||
|
|
@ -1549,8 +1556,8 @@ cip.fillIn = function(combination, onlyPassword, suppressWarnings) {
|
|||
if (countPasswords > 1) {
|
||||
if (!suppressWarnings) {
|
||||
var message = "Error #105\nMore than one login was found in KeePassXC!\n" +
|
||||
"Press the chromeIPass icon for more options.";
|
||||
chrome.extension.sendMessage({
|
||||
"Press the chromeKeePassXC icon for more options.";
|
||||
browser.runtime.sendMessage({
|
||||
action: 'alert',
|
||||
args: [message]
|
||||
});
|
||||
|
|
@ -1559,7 +1566,7 @@ cip.fillIn = function(combination, onlyPassword, suppressWarnings) {
|
|||
else if (countPasswords < 1) {
|
||||
if (!suppressWarnings) {
|
||||
var message = "Error #103\nNo credentials for given username found.";
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'alert',
|
||||
args: [message]
|
||||
});
|
||||
|
|
@ -1570,7 +1577,7 @@ cip.fillIn = function(combination, onlyPassword, suppressWarnings) {
|
|||
if (!suppressWarnings) {
|
||||
var message = "Error #104\nMore than one login was found in KeePassXC!\n" +
|
||||
"Press the chromeKeePassXC icon for more options.";
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'alert',
|
||||
args: [message]
|
||||
});
|
||||
|
|
@ -1663,7 +1670,7 @@ cip.rememberCredentials = function(usernameValue, passwordValue) {
|
|||
}
|
||||
}
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
'action': 'set_remember_credentials',
|
||||
'args': [usernameValue, passwordValue, url, usernameExists, credentialsList]
|
||||
});
|
||||
|
|
@ -1686,7 +1693,7 @@ cipEvents.clearCredentials = function() {
|
|||
for (var i = 0; i < cipFields.combinations.length; i++) {
|
||||
var uField = _f(cipFields.combinations[i].username);
|
||||
if (uField) {
|
||||
if (uField.hasClass("cip-ui-autocomplete-input")) {
|
||||
if (uField.hasClass("ui-autocomplete-input")) {
|
||||
uField.autocomplete("destroy");
|
||||
}
|
||||
}
|
||||
|
|
@ -1701,7 +1708,7 @@ cipEvents.triggerActivatedTab = function() {
|
|||
// initCredentialFields calls also "retrieve_credentials", to prevent it
|
||||
// check of init() was already called
|
||||
if (_called.initCredentialFields && (cip.url || cip.submitUrl) && cip.settings.autoRetrieveCredentials) {
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
'action': 'retrieve_credentials',
|
||||
'args': [ cip.url, cip.submitUrl ]
|
||||
}, cip.retrieveCredentialsCallback);
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 212 B |
|
Before Width: | Height: | Size: 208 B |
|
Before Width: | Height: | Size: 335 B |
|
Before Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 262 B |
|
Before Width: | Height: | Size: 262 B |
|
Before Width: | Height: | Size: 332 B |
|
Before Width: | Height: | Size: 280 B |
1
chromeKeePassXC/jquery-3.2.1.min.map
Normal file
|
|
@ -1,8 +1,9 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "chromeKeePassXC",
|
||||
"version": "0.1.1",
|
||||
"manifest_version": 2,
|
||||
"description": "KeePassXC integration for Chrome",
|
||||
"version": "0.1.2",
|
||||
"description": "KeePassXC integration for modern web browsers",
|
||||
"author": "Sami Vänttinen",
|
||||
"icons": {
|
||||
"16": "icons/keepassxc_16x16.png",
|
||||
"48": "icons/keepassxc_48x48.png",
|
||||
|
|
@ -33,22 +34,9 @@
|
|||
},
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches":
|
||||
[
|
||||
"http://*/*",
|
||||
"https://*/*"
|
||||
],
|
||||
"js":
|
||||
[
|
||||
"jquery-3.2.0.min.js",
|
||||
"jquery-ui.min.js",
|
||||
"chromekeepassxc.js"
|
||||
],
|
||||
"css":
|
||||
[
|
||||
"jquery-ui.min.css",
|
||||
"chromekeepassxc.css"
|
||||
],
|
||||
"matches": [ "http://*/*", "https://*/*" ],
|
||||
"js": [ "jquery-3.2.1.min.js", "jquery-ui.min.js", "chromekeepassxc.js" ],
|
||||
"css": [ "jquery-ui.min.css", "chromekeepassxc.css" ],
|
||||
"run_at": "document_idle",
|
||||
"all_frames": true
|
||||
}
|
||||
|
|
@ -70,18 +58,9 @@
|
|||
}
|
||||
},
|
||||
"web_accessible_resources": [
|
||||
"jquery.min.map",
|
||||
"jquery-3.2.1.min.map",
|
||||
"icons/key_16x16.png",
|
||||
"icons/key_24x24.png",
|
||||
"images/ui-bg_flat_0_aaaaaa_40x100.png",
|
||||
"images/ui-bg_flat_0_aaaaaa_40x100.png",
|
||||
"images/ui-bg_flat_75_ffffff_40x100.png",
|
||||
"images/ui-bg_glass_55_fbf9ee_1x400.png",
|
||||
"images/ui-bg_glass_65_ffffff_1x400.png",
|
||||
"images/ui-bg_glass_75_dadada_1x400.png",
|
||||
"images/ui-bg_glass_75_e6e6e6_1x400.png",
|
||||
"images/ui-bg_glass_95_fef1ec_1x400.png",
|
||||
"images/ui-bg_highlight-soft_75_cccccc_1x100.png"
|
||||
"icons/key_24x24.png"
|
||||
],
|
||||
"permissions": [
|
||||
"contextMenus",
|
||||
|
|
@ -93,5 +72,11 @@
|
|||
"https://*/*",
|
||||
"http://*/*",
|
||||
"https://raw.github.com/"
|
||||
]
|
||||
],
|
||||
"applications": {
|
||||
"gecko": {
|
||||
"id": "chromeKeePassXC@sami.vanttinen",
|
||||
"strict_min_version": "53.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link rel="stylesheet" href="bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="options.css" />
|
||||
<script type="text/javascript" src="../jquery-3.2.0.min.js"></script>
|
||||
<script type="text/javascript" src="../jquery-3.2.1.min.js"></script>
|
||||
<script type="text/javascript" src="bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="options.js"></script>
|
||||
</head>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,10 @@
|
|||
// This quick method Copyright (c) 2016 David Rousset
|
||||
window.browser = (function () {
|
||||
return window.msBrowser ||
|
||||
window.browser ||
|
||||
window.chrome;
|
||||
})();
|
||||
|
||||
if (jQuery) {
|
||||
var $ = jQuery.noConflict(true);
|
||||
}
|
||||
|
|
@ -36,7 +43,7 @@ options.initGeneralSettings = function() {
|
|||
options.settings[$(this).attr("name")] = $(this).is(':checked');
|
||||
localStorage.settings = JSON.stringify(options.settings);
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'load_settings'
|
||||
});
|
||||
});
|
||||
|
|
@ -51,19 +58,19 @@ options.initGeneralSettings = function() {
|
|||
options.settings[$(this).attr("name")] = $(this).val();
|
||||
localStorage.settings = JSON.stringify(options.settings);
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'load_settings'
|
||||
});
|
||||
});
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: "get_keepassxc_versions"
|
||||
}, options.showKeePassXCVersions);
|
||||
|
||||
$("#tab-general-settings button.checkUpdateKeePassXC:first").click(function(e) {
|
||||
e.preventDefault();
|
||||
$(this).attr("disabled", true);
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: "check_update_keepassxc"
|
||||
}, options.showKeePassXCVersions);
|
||||
});
|
||||
|
|
@ -87,7 +94,7 @@ options.initGeneralSettings = function() {
|
|||
|
||||
localStorage.settings = JSON.stringify(options.settings);
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'load_settings'
|
||||
});
|
||||
});
|
||||
|
|
@ -102,7 +109,7 @@ options.initGeneralSettings = function() {
|
|||
|
||||
localStorage.settings = JSON.stringify(options.settings);
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'load_settings'
|
||||
});
|
||||
});
|
||||
|
|
@ -117,7 +124,7 @@ options.initGeneralSettings = function() {
|
|||
|
||||
localStorage.settings = JSON.stringify(options.settings);
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'load_settings'
|
||||
});
|
||||
});
|
||||
|
|
@ -156,7 +163,7 @@ options.initConnectedDatabases = function() {
|
|||
delete options.keyRing[$hash];
|
||||
localStorage.keyRing = JSON.stringify(options.keyRing);
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'load_keyring'
|
||||
});
|
||||
|
||||
|
|
@ -197,7 +204,7 @@ options.initConnectedDatabases = function() {
|
|||
}
|
||||
|
||||
$("#connect-button").click(function() {
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: "associate"
|
||||
});
|
||||
});
|
||||
|
|
@ -223,7 +230,7 @@ options.initSpecifiedCredentialFields = function() {
|
|||
delete options.settings["defined-credential-fields"][$url];
|
||||
localStorage.settings = JSON.stringify(options.settings);
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'load_settings'
|
||||
});
|
||||
|
||||
|
|
@ -257,5 +264,5 @@ options.initSpecifiedCredentialFields = function() {
|
|||
}
|
||||
|
||||
options.initAbout = function() {
|
||||
$("#tab-about em.versionCIP").text(chrome.app.getDetails().version);
|
||||
$("#tab-about em.versionCIP").text(browser.app.getDetails().version);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<title>KeePassXC - Popup</title>
|
||||
<link rel="stylesheet" href="popup.css" />
|
||||
<link rel="stylesheet" href="../options/bootstrap.min.css" />
|
||||
<script type="text/javascript" src="../jquery-3.2.0.min.js"></script>
|
||||
<script type="text/javascript" src="../jquery-3.2.1.min.js"></script>
|
||||
<script type="text/javascript" src="../options/bootstrap.min.js" /></script>
|
||||
<script type="text/javascript" src="popup_functions.js" /></script>
|
||||
<script type="text/javascript" src="popup.js" /></script>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,10 @@
|
|||
// This quick method Copyright (c) 2016 David Rousset
|
||||
window.browser = (function () {
|
||||
return window.msBrowser ||
|
||||
window.browser ||
|
||||
window.chrome;
|
||||
})();
|
||||
|
||||
function status_response(r) {
|
||||
$('#initial-state').hide();
|
||||
$('#error-encountered').hide();
|
||||
|
|
@ -35,38 +42,38 @@ function status_response(r) {
|
|||
|
||||
$(function() {
|
||||
$("#connect-button").click(function() {
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: "associate"
|
||||
});
|
||||
close();
|
||||
});
|
||||
|
||||
$("#reconnect-button").click(function() {
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: "associate"
|
||||
});
|
||||
close();
|
||||
});
|
||||
|
||||
$("#reload-status-button").click(function() {
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: "get_status"
|
||||
}, status_response);
|
||||
});
|
||||
|
||||
$("#redetect-fields-button").click(function() {
|
||||
chrome.tabs.query({"active": true, "windowId": chrome.windows.WINDOW_ID_CURRENT}, function(tabs) {
|
||||
browser.tabs.query({"active": true, "windowId": browser.windows.WINDOW_ID_CURRENT}, function(tabs) {
|
||||
if (tabs.length === 0)
|
||||
return; // For example: only the background devtools or a popup are opened
|
||||
var tab = tabs[0];
|
||||
|
||||
chrome.tabs.sendMessage(tab.id, {
|
||||
browser.tabs.sendMessage(tab.id, {
|
||||
action: "redetect_fields"
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: "get_status"
|
||||
}, status_response);
|
||||
});
|
||||
|
|
@ -1,6 +1,13 @@
|
|||
// This quick method Copyright (c) 2016 David Rousset
|
||||
window.browser = (function () {
|
||||
return window.msBrowser ||
|
||||
window.browser ||
|
||||
window.chrome;
|
||||
})();
|
||||
|
||||
var $ = jQuery.noConflict(true);
|
||||
var _settings = typeof(localStorage.settings)=='undefined' ? {} : JSON.parse(localStorage.settings);
|
||||
//var global = chrome.extension.getBackgroundPage();
|
||||
//var global = browser.runtime.getBackgroundPage();
|
||||
|
||||
function updateAvailableResponse(available) {
|
||||
if(available) {
|
||||
|
|
@ -14,17 +21,18 @@ function updateAvailableResponse(available) {
|
|||
function initSettings() {
|
||||
$("#settings #btn-options").click(function() {
|
||||
close();
|
||||
chrome.tabs.create({
|
||||
browser.tabs.create({
|
||||
url: "../options/options.html"
|
||||
})
|
||||
});
|
||||
|
||||
$("#settings #btn-choose-credential-fields").click(function() {
|
||||
var global = chrome.extension.getBackgroundPage();
|
||||
chrome.tabs.sendMessage(global.page.currentTabId, {
|
||||
action: "choose_credential_fields"
|
||||
browser.runtime.getBackgroundPage(function(global) {
|
||||
browser.tabs.sendMessage(global.page.currentTabId, {
|
||||
action: "choose_credential_fields"
|
||||
});
|
||||
close();
|
||||
});
|
||||
close();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -32,7 +40,7 @@ function initSettings() {
|
|||
$(function() {
|
||||
initSettings();
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: "update_available_keepassxc"
|
||||
}, updateAvailableResponse);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<title>KeePassXC - Popup</title>
|
||||
<link rel="stylesheet" href="popup.css" />
|
||||
<link rel="stylesheet" href="../options/bootstrap.min.css" />
|
||||
<script type="text/javascript" src="../jquery-3.2.0.min.js"></script>
|
||||
<script type="text/javascript" src="../jquery-3.2.1.min.js"></script>
|
||||
<script type="text/javascript" src="../options/bootstrap.min.js" /></script>
|
||||
<script type="text/javascript" src="popup_functions.js"></script>
|
||||
<script type="text/javascript" src="popup_httpauth.js"></script>
|
||||
|
|
|
|||
|
|
@ -1,21 +1,28 @@
|
|||
$(function() {
|
||||
var global = chrome.extension.getBackgroundPage();
|
||||
// This quick method Copyright (c) 2016 David Rousset
|
||||
window.browser = (function () {
|
||||
return window.msBrowser ||
|
||||
window.browser ||
|
||||
window.chrome;
|
||||
})();
|
||||
|
||||
chrome.tabs.getSelected(null, function(tab) {
|
||||
//var data = global.tab_httpauth_list["tab" + tab.id];
|
||||
var data = global.page.tabs[tab.id].loginList;
|
||||
var ul = document.getElementById("login-list");
|
||||
for (var i = 0; i < data.logins.length; i++) {
|
||||
var li = document.createElement("li");
|
||||
var a = document.createElement("a");
|
||||
a.textContent = data.logins[i].login + " (" + data.logins[i].name + ")";
|
||||
li.appendChild(a);
|
||||
$(a).data("url", data.url.replace(/:\/\//g, "://" + data.logins[i].login + ":" + data.logins[i].password + "@"));
|
||||
$(a).click(function() {
|
||||
chrome.tabs.update(tab.id, {"url": $(this).data("url")});
|
||||
close();
|
||||
});
|
||||
ul.appendChild(li);
|
||||
}
|
||||
$(function() {
|
||||
browser.runtime.getBackgroundPage(function(global) {
|
||||
browser.tabs.getSelected(null, function(tab) {
|
||||
//var data = global.tab_httpauth_list["tab" + tab.id];
|
||||
var data = global.page.tabs[tab.id].loginList;
|
||||
var ul = document.getElementById("login-list");
|
||||
for (var i = 0; i < data.logins.length; i++) {
|
||||
var li = document.createElement("li");
|
||||
var a = document.createElement("a");
|
||||
a.textContent = data.logins[i].login + " (" + data.logins[i].name + ")";
|
||||
li.appendChild(a);
|
||||
$(a).data("url", data.url.replace(/:\/\//g, "://" + data.logins[i].login + ":" + data.logins[i].password + "@"));
|
||||
$(a).click(function() {
|
||||
browser.tabs.update(tab.id, {"url": $(this).data("url")});
|
||||
close();
|
||||
});
|
||||
ul.appendChild(li);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
<title>KeePassXC - Popup</title>
|
||||
<link rel="stylesheet" href="popup.css" />
|
||||
<link rel="stylesheet" href="../options/bootstrap.min.css" />
|
||||
<script type="text/javascript" src="../jquery-3.2.0.min.js"></script>
|
||||
<script type="text/javascript" src="../jquery-3.2.1.min.js"></script>
|
||||
<script type="text/javascript" src="../options/bootstrap.min.js" /></script>
|
||||
<script type="text/javascript" src="popup_functions.js"></script>
|
||||
<script type="text/javascript" src="popup_login.js"></script>
|
||||
|
|
|
|||
|
|
@ -1,28 +1,35 @@
|
|||
// This quick method Copyright (c) 2016 David Rousset
|
||||
window.browser = (function () {
|
||||
return window.msBrowser ||
|
||||
window.browser ||
|
||||
window.chrome;
|
||||
})();
|
||||
|
||||
$(function() {
|
||||
var global = chrome.extension.getBackgroundPage();
|
||||
browser.runtime.getBackgroundPage(function(global) {
|
||||
browser.tabs.query({"active": true, "windowId": browser.windows.WINDOW_ID_CURRENT}, function(tabs) {
|
||||
if (tabs.length === 0)
|
||||
return; // For example: only the background devtools or a popup are opened
|
||||
var tab = tabs[0];
|
||||
|
||||
chrome.tabs.query({"active": true, "windowId": chrome.windows.WINDOW_ID_CURRENT}, function(tabs) {
|
||||
if (tabs.length === 0)
|
||||
return; // For example: only the background devtools or a popup are opened
|
||||
var tab = tabs[0];
|
||||
|
||||
var logins = global.page.tabs[tab.id].loginList;
|
||||
var ul = document.getElementById("login-list");
|
||||
for (var i = 0; i < logins.length; i++) {
|
||||
var li = document.createElement("li");
|
||||
var a = document.createElement("a");
|
||||
a.textContent = logins[i];
|
||||
li.appendChild(a);
|
||||
a.setAttribute("id", "" + i);
|
||||
a.addEventListener('click', function(e) {
|
||||
var id = e.target.id;
|
||||
chrome.tabs.sendMessage(tab.id, {
|
||||
action: 'fill_user_pass_with_specific_login',
|
||||
id: id
|
||||
var logins = global.page.tabs[tab.id].loginList;
|
||||
var ul = document.getElementById("login-list");
|
||||
for (var i = 0; i < logins.length; i++) {
|
||||
var li = document.createElement("li");
|
||||
var a = document.createElement("a");
|
||||
a.textContent = logins[i];
|
||||
li.appendChild(a);
|
||||
a.setAttribute("id", "" + i);
|
||||
a.addEventListener('click', function(e) {
|
||||
var id = e.target.id;
|
||||
browser.tabs.sendMessage(tab.id, {
|
||||
action: 'fill_user_pass_with_specific_login',
|
||||
id: id
|
||||
});
|
||||
close();
|
||||
});
|
||||
close();
|
||||
});
|
||||
ul.appendChild(li);
|
||||
}
|
||||
});
|
||||
ul.appendChild(li);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
<title>KeePassXC - Popup</title>
|
||||
<link rel="stylesheet" href="popup.css" />
|
||||
<link rel="stylesheet" href="../options/bootstrap.min.css" />
|
||||
<script type="text/javascript" src="../jquery-3.2.0.min.js"></script>
|
||||
<script type="text/javascript" src="../jquery-3.2.1.min.js"></script>
|
||||
<script type="text/javascript" src="../options/bootstrap.min.js" /></script>
|
||||
<script type="text/javascript" src="popup_functions.js"></script>
|
||||
</head>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<title>KeePassXC - Popup</title>
|
||||
<link rel="stylesheet" href="popup.css" />
|
||||
<link rel="stylesheet" href="../options/bootstrap.min.css" />
|
||||
<script type="text/javascript" src="../jquery-3.2.0.min.js"></script>
|
||||
<script type="text/javascript" src="../jquery-3.2.1.min.js"></script>
|
||||
<script type="text/javascript" src="../options/bootstrap.min.js" /></script>
|
||||
<script type="text/javascript" src="popup_functions.js"></script>
|
||||
<script type="text/javascript" src="popup_remember.js"></script>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,10 @@
|
|||
// This quick method Copyright (c) 2016 David Rousset
|
||||
window.browser = (function () {
|
||||
return window.msBrowser ||
|
||||
window.browser ||
|
||||
window.chrome;
|
||||
})();
|
||||
|
||||
var _tab;
|
||||
|
||||
function _initialize(tab) {
|
||||
|
|
@ -20,7 +27,7 @@ function _initialize(tab) {
|
|||
$(".information-username:first span:first").text(_tab.credentials.username);
|
||||
|
||||
$("#btn-new").click(function(e) {
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'add_credentials',
|
||||
args: [_tab.credentials.username, _tab.credentials.password, _tab.credentials.url]
|
||||
}, _verifyResult);
|
||||
|
|
@ -31,7 +38,7 @@ function _initialize(tab) {
|
|||
|
||||
// only one entry which could be updated
|
||||
if(_tab.credentials.list.length == 1) {
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'update_credentials',
|
||||
args: [_tab.credentials.list[0].uuid, _tab.credentials.username, _tab.credentials.password, _tab.credentials.url]
|
||||
}, _verifyResult);
|
||||
|
|
@ -56,7 +63,7 @@ function _initialize(tab) {
|
|||
.data("entryId", i)
|
||||
.click(function(e) {
|
||||
e.preventDefault();
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'update_credentials',
|
||||
args: [_tab.credentials.list[$(this).data("entryId")].uuid, _tab.credentials.username, _tab.credentials.password, _tab.credentials.url]
|
||||
}, _verifyResult);
|
||||
|
|
@ -97,11 +104,11 @@ function _verifyResult(code) {
|
|||
}
|
||||
|
||||
function _close() {
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'remove_credentials_from_tab_information'
|
||||
});
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'pop_stack'
|
||||
});
|
||||
|
||||
|
|
@ -109,16 +116,16 @@ function _close() {
|
|||
}
|
||||
|
||||
$(function() {
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'stack_add',
|
||||
args: ["icon_remember_red_background_19x19.png", "popup_remember.html", 10, true, 0]
|
||||
});
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'get_tab_information'
|
||||
}, _initialize);
|
||||
|
||||
chrome.extension.sendMessage({
|
||||
browser.runtime.sendMessage({
|
||||
action: 'get_connected_database'
|
||||
}, _connected_database);
|
||||
});
|
||||