mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
More error message related fixes
This commit is contained in:
parent
0144b7e2dd
commit
bb5c4806b4
13 changed files with 41 additions and 14 deletions
|
|
@ -1,7 +1,11 @@
|
|||
0.2.7 (2017-??-??)
|
||||
0.2.7 (2017-07-31)
|
||||
=========================
|
||||
- Some Firefox related changes (credits to projectgus)
|
||||
- Fixed Skip button function when choosing own credential fields
|
||||
- Adjusted some callbacks
|
||||
- Fixed showing an error message on the same tab when KeePassXC is instantly closed
|
||||
- Added null checking for onDisconnected()
|
||||
- Any Chrome related stuff is now disabled on options pages when using Firefox
|
||||
|
||||
0.2.6 (2017-07-23)
|
||||
=========================
|
||||
|
|
|
|||
|
|
@ -249,7 +249,9 @@ function getValueOrDefault(settings, key, defaultVal, min) {
|
|||
val = defaultVal;
|
||||
}
|
||||
return val;
|
||||
} catch(e) { return defaultVal; }
|
||||
} catch(e) {
|
||||
return defaultVal;
|
||||
}
|
||||
}
|
||||
|
||||
browserAction.generateIconName = function(iconType, icon) {
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ event.showStatus = function(configured, tab, callback) {
|
|||
}
|
||||
|
||||
browserAction.showDefault(null, tab);
|
||||
const errorMessage = page.tabs[tab.id].errorMessage;
|
||||
callback({
|
||||
identifier: keyId,
|
||||
configured: configured,
|
||||
|
|
@ -97,7 +98,7 @@ event.showStatus = function(configured, tab, callback) {
|
|||
keePassXCAvailable: keepass.isKeePassXCAvailable,
|
||||
encryptionKeyUnrecognized: keepass.isEncryptionKeyUnrecognized,
|
||||
associated: keepass.isAssociated(),
|
||||
error: page.tabs[tab.id].errorMessage
|
||||
error: errorMessage ? errorMessage : null
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,11 +82,9 @@ browser.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
|
|||
});
|
||||
|
||||
// Retrieve Credentials and try auto-login for HTTPAuth requests
|
||||
if (browser.webRequest.onAuthRequired) {
|
||||
browser.webRequest.onAuthRequired.addListener(httpAuth.handleRequest,
|
||||
{ urls: ['<all_urls>'] }, ['asyncBlocking']
|
||||
);
|
||||
}
|
||||
browser.webRequest.onAuthRequired.addListener(httpAuth.handleRequest,
|
||||
{ urls: ['<all_urls>'] }, ['asyncBlocking']
|
||||
);
|
||||
|
||||
browser.runtime.onMessage.addListener(event.onMessage);
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ const kpErrors = {
|
|||
KEY_CHANGE_FAILED: 9,
|
||||
ENCRYPTION_KEY_UNRECOGNIZED: 10,
|
||||
NO_SAVED_DATABASES_FOUND: 11,
|
||||
|
||||
errorMessages : {
|
||||
0: { msg: 'Unknown error' },
|
||||
1: { msg: 'Database not opened' },
|
||||
|
|
@ -58,6 +59,10 @@ const kpErrors = {
|
|||
9: { msg: 'Key change was not successful.' },
|
||||
10: { msg: 'Encryption key is not recognized' },
|
||||
11: { msg: 'No saved databases found.' }
|
||||
},
|
||||
|
||||
getError(errorCode) {
|
||||
return this.errorMessages[errorCode].msg;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -139,6 +144,7 @@ keepass.retrieveCredentials = function (callback, tab, url, submiturl, forceCall
|
|||
page.tabs[tab.id].errorMessage = null;
|
||||
|
||||
if (!keepass.isConnected) {
|
||||
callback([]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -199,7 +205,7 @@ keepass.retrieveCredentials = function (callback, tab, url, submiturl, forceCall
|
|||
|
||||
// Redirects the callback to a listener (handleReply())
|
||||
keepass.callbackOnId = function (ev, id, callback) {
|
||||
let listener = ( (port, id) => {
|
||||
let listener = ((port, id) => {
|
||||
let handler = (msg) => {
|
||||
if (msg && msg.action === id) {
|
||||
ev.removeListener(handler);
|
||||
|
|
@ -275,11 +281,13 @@ keepass.generatePassword = function (callback, tab, forceCallback) {
|
|||
|
||||
keepass.associate = function(callback, tab) {
|
||||
if (keepass.isAssociated()) {
|
||||
callback([]);
|
||||
return;
|
||||
}
|
||||
|
||||
keepass.getDatabaseHash((res) => {
|
||||
if (keepass.isDatabaseClosed || !keepass.isKeePassXCAvailable) {
|
||||
callback([]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -487,6 +495,7 @@ keepass.getDatabaseHash = function (callback, tab, triggerUnlock) {
|
|||
|
||||
keepass.changePublicKeys = function(tab, callback) {
|
||||
if (!keepass.isConnected) {
|
||||
callback([]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -652,11 +661,11 @@ keepass.onNativeMessage = function (response) {
|
|||
}
|
||||
|
||||
function onDisconnected() {
|
||||
console.log('Failed to connect: ' + browser.runtime.lastError.message);
|
||||
keepass.nativePort = null;
|
||||
keepass.isConnected = false;
|
||||
keepass.isDatabaseClosed = true;
|
||||
keepass.isKeePassXCAvailable = false;
|
||||
console.log('Failed to connect: ' + (browser.runtime.lastError === null ? 'Unknown error' : browser.runtime.lastError.message));
|
||||
}
|
||||
|
||||
keepass.nativeConnect = function() {
|
||||
|
|
@ -714,7 +723,7 @@ keepass.verifyResponse = function(response, nonce, id) {
|
|||
|
||||
keepass.handleError = function(tab, errorCode, errorMessage = '') {
|
||||
if (errorMessage.length === 0) {
|
||||
errorMessage = kpErrors.errorMessages[errorCode].msg;
|
||||
errorMessage = kpErrors.getError(errorCode);
|
||||
}
|
||||
console.log('Error ' + errorCode + ': ' + errorMessage);
|
||||
if (tab && page.tabs[tab.id]) {
|
||||
|
|
|
|||
|
|
@ -79,7 +79,6 @@ function _fs(fieldId) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
var cipAutocomplete = {};
|
||||
|
||||
// objects of username + description for autocomplete
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Settings | keepassxc-browser</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="options.css" />
|
||||
<script type="text/javascript" src="../jquery-3.2.1.min.js"></script>
|
||||
|
|
@ -29,7 +29,8 @@
|
|||
<p>
|
||||
If you just want to insert username + password into the fields where your focus is, press <code>Ctrl + Shift + U</code>.
|
||||
<br />
|
||||
If you only want to insert the password, just press <code>Ctrl + Shift + P</code>. You can customize these shortcuts on <code>chrome://extensions/configureCommands</code> page
|
||||
If you only want to insert the password, just press <code>Ctrl + Shift + P</code>.
|
||||
<span id="chrome-only">You can customize these shortcuts on <code>chrome://extensions/configureCommands</code> page</span>
|
||||
</p>
|
||||
<p>
|
||||
<div class="form-group">
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
var isFirefox = false;
|
||||
if (typeof browser !== 'undefined') {
|
||||
isFirefox = true;
|
||||
}
|
||||
|
||||
window.browser = (function () { return window.msBrowser || window.browser || window.chrome; })();
|
||||
|
||||
if (jQuery) {
|
||||
|
|
@ -257,4 +262,7 @@ options.initSpecifiedCredentialFields = function() {
|
|||
|
||||
options.initAbout = function() {
|
||||
$('#tab-about em.versionCIP').text(browser.runtime.getManifest().version);
|
||||
if (isFirefox) {
|
||||
$('#chrome-only').remove();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>KeePassXC - Popup</title>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="popup.css" />
|
||||
<link rel="stylesheet" href="../options/bootstrap.min.css" />
|
||||
<script type="text/javascript" src="../jquery-3.2.1.min.js"></script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>keepassxc-browser - Popup</title>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="popup.css" />
|
||||
<link rel="stylesheet" href="../options/bootstrap.min.css" />
|
||||
<script type="text/javascript" src="../jquery-3.2.1.min.js"></script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>KeePassXC - Popup</title>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="popup.css" />
|
||||
<link rel="stylesheet" href="../options/bootstrap.min.css" />
|
||||
<script type="text/javascript" src="../jquery-3.2.1.min.js"></script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>keepassxc-browser - Popup</title>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="popup.css" />
|
||||
<link rel="stylesheet" href="../options/bootstrap.min.css" />
|
||||
<script type="text/javascript" src="../jquery-3.2.1.min.js"></script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>keepassxc-browser - Popup</title>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="popup.css" />
|
||||
<link rel="stylesheet" href="../options/bootstrap.min.css" />
|
||||
<script type="text/javascript" src="../jquery-3.2.1.min.js"></script>
|
||||
|
|
|
|||
Loading…
Reference in a new issue