From 301f04a2eb83ec53c8253158f1599650b98b67ce Mon Sep 17 00:00:00 2001 From: varjolintu Date: Fri, 19 May 2017 15:48:17 +0300 Subject: [PATCH] Fixed a bug with status text. Added some licence and updated the README. --- README.md | 33 +++++++++++++++++++++ chromeKeePassXC/background/browserAction.js | 1 - chromeKeePassXC/background/event.js | 1 - chromeKeePassXC/background/init.js | 1 - chromeKeePassXC/background/keepass.js | 4 +-- chromeKeePassXC/background/page.js | 1 - chromeKeePassXC/chromekeepassxc.js | 1 - chromeKeePassXC/options/options.js | 1 - chromeKeePassXC/popups/popup.js | 5 +--- chromeKeePassXC/popups/popup_functions.js | 1 - chromeKeePassXC/popups/popup_httpauth.js | 1 - chromeKeePassXC/popups/popup_login.js | 1 - chromeKeePassXC/popups/popup_remember.js | 1 - 13 files changed, 36 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index b12c3a6..9e5e4bd 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,39 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . ``` +The following quick method to determine which browser is used with API calls by [David Rousset](https://github.com/davrous): +```javascript +window.browser = (function () { + return window.msBrowser || + window.browser || + window.chrome; +})(); +``` + +``` +MIT License + +Copyright (c) 2016 David Rousset + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +``` + ## Protocol Transmitting messages between KeePassXC and chromeKeePassXC is totally rewritten. This is still under development. diff --git a/chromeKeePassXC/background/browserAction.js b/chromeKeePassXC/background/browserAction.js index c7f032d..7833f2b 100644 --- a/chromeKeePassXC/background/browserAction.js +++ b/chromeKeePassXC/background/browserAction.js @@ -1,4 +1,3 @@ -// This quick method Copyright (c) 2016 David Rousset window.browser = (function () { return window.msBrowser || window.browser || diff --git a/chromeKeePassXC/background/event.js b/chromeKeePassXC/background/event.js index a26db20..373f24f 100644 --- a/chromeKeePassXC/background/event.js +++ b/chromeKeePassXC/background/event.js @@ -1,4 +1,3 @@ -// This quick method Copyright (c) 2016 David Rousset window.browser = (function () { return window.msBrowser || window.browser || diff --git a/chromeKeePassXC/background/init.js b/chromeKeePassXC/background/init.js index c8c6d2f..25d95cf 100644 --- a/chromeKeePassXC/background/init.js +++ b/chromeKeePassXC/background/init.js @@ -11,7 +11,6 @@ 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 || diff --git a/chromeKeePassXC/background/keepass.js b/chromeKeePassXC/background/keepass.js index bb5d16a..9d4ad25 100644 --- a/chromeKeePassXC/background/keepass.js +++ b/chromeKeePassXC/background/keepass.js @@ -20,7 +20,6 @@ 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 || @@ -447,11 +446,12 @@ keepass.testAssociation = function (callback, tab, triggerUnlock) { keepass.getDatabaseHash = function (callback, tab, triggerUnlock) { if (!keepass.isConnected) { page.tabs[tab.id].errorMessage = "Not connected with KeePassXC."; + callback([]); return; } if (!keepass.serverPublicKey) { - keepass.changePublicKeys(tab, null); + keepass.changePublicKeys(tab, function(res) {}); } var message = { "action": "get-databasehash" }; diff --git a/chromeKeePassXC/background/page.js b/chromeKeePassXC/background/page.js index d67ad9d..e5367e9 100644 --- a/chromeKeePassXC/background/page.js +++ b/chromeKeePassXC/background/page.js @@ -1,4 +1,3 @@ -// This quick method Copyright (c) 2016 David Rousset window.browser = (function () { return window.msBrowser || window.browser || diff --git a/chromeKeePassXC/chromekeepassxc.js b/chromeKeePassXC/chromekeepassxc.js index 41ab98d..b90d551 100644 --- a/chromeKeePassXC/chromekeepassxc.js +++ b/chromeKeePassXC/chromekeepassxc.js @@ -1,4 +1,3 @@ -// This quick method Copyright (c) 2016 David Rousset window.browser = (function () { return window.msBrowser || window.browser || diff --git a/chromeKeePassXC/options/options.js b/chromeKeePassXC/options/options.js index 14bdc56..ce223a8 100644 --- a/chromeKeePassXC/options/options.js +++ b/chromeKeePassXC/options/options.js @@ -1,4 +1,3 @@ -// This quick method Copyright (c) 2016 David Rousset window.browser = (function () { return window.msBrowser || window.browser || diff --git a/chromeKeePassXC/popups/popup.js b/chromeKeePassXC/popups/popup.js index a3b9808..85321cd 100644 --- a/chromeKeePassXC/popups/popup.js +++ b/chromeKeePassXC/popups/popup.js @@ -1,4 +1,3 @@ -// This quick method Copyright (c) 2016 David Rousset window.browser = (function () { return window.msBrowser || window.browser || @@ -25,12 +24,10 @@ function status_response(r) { $('#need-reconfigure-message').html(r.error); } else if(!r.associated) { - //$('#configured-not-associated').show(); - //$('#unassociated-identifier').html(r.identifier); $('#need-reconfigure').show(); $('#need-reconfigure-message').html(r.error); } - else if(typeof(r.error) != "undefined") { + else if(typeof(r.error) != "undefined" || r.error != null) { $('#error-encountered').show(); $('#error-message').html(r.error); } diff --git a/chromeKeePassXC/popups/popup_functions.js b/chromeKeePassXC/popups/popup_functions.js index b14742a..dfcd4bc 100644 --- a/chromeKeePassXC/popups/popup_functions.js +++ b/chromeKeePassXC/popups/popup_functions.js @@ -1,4 +1,3 @@ -// This quick method Copyright (c) 2016 David Rousset window.browser = (function () { return window.msBrowser || window.browser || diff --git a/chromeKeePassXC/popups/popup_httpauth.js b/chromeKeePassXC/popups/popup_httpauth.js index 713924f..80ecc67 100644 --- a/chromeKeePassXC/popups/popup_httpauth.js +++ b/chromeKeePassXC/popups/popup_httpauth.js @@ -1,4 +1,3 @@ -// This quick method Copyright (c) 2016 David Rousset window.browser = (function () { return window.msBrowser || window.browser || diff --git a/chromeKeePassXC/popups/popup_login.js b/chromeKeePassXC/popups/popup_login.js index 6dec593..8767d17 100644 --- a/chromeKeePassXC/popups/popup_login.js +++ b/chromeKeePassXC/popups/popup_login.js @@ -1,4 +1,3 @@ -// This quick method Copyright (c) 2016 David Rousset window.browser = (function () { return window.msBrowser || window.browser || diff --git a/chromeKeePassXC/popups/popup_remember.js b/chromeKeePassXC/popups/popup_remember.js index 88a0c9d..f42d5ab 100644 --- a/chromeKeePassXC/popups/popup_remember.js +++ b/chromeKeePassXC/popups/popup_remember.js @@ -1,4 +1,3 @@ -// This quick method Copyright (c) 2016 David Rousset window.browser = (function () { return window.msBrowser || window.browser ||