Fixed showing correct status messages

This commit is contained in:
varjolintu 2017-06-13 13:28:36 +03:00
parent 36063e5fe3
commit 666d783b6f
4 changed files with 10 additions and 10 deletions

View file

@ -128,6 +128,7 @@ event.onGetStatus = function(callback, tab) {
browserAction.showDefault(null, tab);
console.log(page.tabs[tab.id].errorMessage);
console.log("Configured: " + configured + " Key id: " + keyId + " closed: " + keepass.isDatabaseClosed + " avail: " + keepass.isKeePassXCAvailable + " unreg: " + keepass.isEncryptionKeyUnrecognized + " isass: " + keepass.isAssociated());
callback({
identifier: keyId,
configured: configured,

View file

@ -33,9 +33,9 @@ var _interval = 250;
* @param {object} tab
*/
browser.tabs.onCreated.addListener(function(tab) {
if(tab.id > 0) {
if (tab.id > 0) {
//console.log("browser.tabs.onCreated(" + tab.id+ ")");
if(tab.selected) {
if (tab.selected) {
page.currentTabId = tab.id;
event.invoke(page.switchTab, null, tab.id, []);
}
@ -49,7 +49,7 @@ browser.tabs.onCreated.addListener(function(tab) {
*/
browser.tabs.onRemoved.addListener(function(tabId, removeInfo) {
delete page.tabs[tabId];
if(page.currentTabId == tabId) {
if (page.currentTabId == tabId) {
page.currentTabId = -1;
}
});
@ -66,9 +66,9 @@ browser.tabs.onActivated.addListener(function(activeInfo) {
browser.tabs.get(activeInfo.tabId, function(info) {
//console.log(info.id + ": " + info.url);
if(info && info.id) {
if (info && info.id) {
page.currentTabId = info.id;
if(info.status == "complete") {
if (info.status == "complete") {
//console.log("event.invoke(page.switchTab, null, "+info.id + ", []);");
event.invoke(page.switchTab, null, info.id, []);
}
@ -82,7 +82,7 @@ browser.tabs.onActivated.addListener(function(activeInfo) {
* @param {object} changeInfo
*/
browser.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
if(changeInfo.status == "complete") {
if (changeInfo.status == "complete") {
event.invoke(browserAction.removeRememberPopup, null, tabId, []);
}
});

View file

@ -15,7 +15,7 @@ keepass.nativePort = null;
keepass.keySize = 24;
keepass.latestVersionUrl = "https://raw.githubusercontent.com/keepassxreboot/keepassxc/develop/CHANGELOG";
keepass.cacheTimeout = 30 * 1000; // milliseconds
keepass.databaseHash = "no-hash"; //no-hash = keepasshttp is too old and does not return a hash value
keepass.databaseHash = "no-hash"; //no-hash = KeePassXC is too old and does not return a hash value
keepass.keyRing = (typeof(localStorage.keyRing) == 'undefined') ? {} : JSON.parse(localStorage.keyRing);
keepass.keyId = "chromekeepassxc-cryptokey-name";
keepass.keyBody = "chromekeepassxc-key";
@ -237,8 +237,6 @@ keepass.generatePassword = function (callback, tab, forceCallback) {
keepass.setcurrentKeePassXCVersion(parsed.version);
if (keepass.verifyResponse(parsed, response.nonce)) {
var rIv = response.nonce;
// var response = JSON.stringify({ Login: (msg.password.length * 8), Password: msg.password });
if (parsed.entries) {
passwords = parsed.entries;
keepass.updateLastUsed(keepass.databaseHash);

View file

@ -5,6 +5,7 @@ window.browser = (function () {
})();
function status_response(r) {
console.log(r);
$('#initial-state').hide();
$('#error-encountered').hide();
$('#need-reconfigure').hide();
@ -27,7 +28,7 @@ function status_response(r) {
$('#need-reconfigure').show();
$('#need-reconfigure-message').html(r.error);
}
else if(typeof(r.error) != "undefined" || r.error != null) {
else if (r.error != null) {
$('#error-encountered').show();
$('#error-message').html(r.error);
}