diff --git a/README.md b/README.md index 9e5e4bd..986ce02 100644 --- a/README.md +++ b/README.md @@ -3,54 +3,6 @@ Chrome extension for [KeePassXC](https://keepassxc.org/) with Native Messaging. This is a heavily forked version of [pfn](https://github.com/pfn)'s [chromeIPass](https://github.com/pfn/passifox). -``` -PassIFox & ChromeIPass Copyright © 2010-2017 Perry Nguyen -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, version 3 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -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. @@ -264,3 +216,53 @@ Response message data (success, decrypted): "version": "2.1.2" } ``` + +## Licenses + +``` +PassIFox & ChromeIPass Copyright © 2010-2017 Perry Nguyen +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +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. +``` \ No newline at end of file diff --git a/chromeKeePassXC/chromekeepassxc.css b/chromeKeePassXC/chromekeepassxc.css index 3f18563..2ed1f9b 100644 --- a/chromeKeePassXC/chromekeepassxc.css +++ b/chromeKeePassXC/chromekeepassxc.css @@ -52,6 +52,16 @@ height: 24px; background-image: url(chrome-extension://__MSG_@@extension_id__/icons/key_24x24.png); } +.cip-genpw-icon.cip-icon-key-small-moz { + width: 16px; + height: 16px; + background-image: url(moz-extension://__MSG_@@extension_id__/icons/key_16x16.png); +} +.cip-genpw-icon.cip-icon-key-big-moz { + width: 24px; + height: 24px; + background-image: url(moz-extension://__MSG_@@extension_id__/icons/key_24x24.png); +} .cip-genpw-password-frame { margin-top: 5px !important; margin-bottom: 5px !important; diff --git a/chromeKeePassXC/chromekeepassxc.js b/chromeKeePassXC/chromekeepassxc.js index b90d551..da244fa 100644 --- a/chromeKeePassXC/chromekeepassxc.js +++ b/chromeKeePassXC/chromekeepassxc.js @@ -1,3 +1,8 @@ +var isFirefox = false; +if (typeof browser !== 'undefined') { + isFirefox = true; +} + window.browser = (function () { return window.msBrowser || window.browser || @@ -332,7 +337,7 @@ cipPassword.createDialog = function() { } cipPassword.createIcon = function(field) { - var $className = (field.outerHeight() > 28) ? "cip-icon-key-big" : "cip-icon-key-small"; + var $className = (field.outerHeight() > 28) ? (isFirefox ? "cip-icon-key-big-moz" : "cip-icon-key-big") : (isFirefox ? "cip-icon-key-small-moz" : "cip-icon-key-small"); var $size = (field.outerHeight() > 28) ? 24 : 16; var $offset = Math.floor((field.outerHeight() - $size) / 3); $offset = ($offset < 0) ? 0 : $offset; @@ -780,7 +785,7 @@ cipDefine.prepareStep3 = function() { -cipFields = {} +var cipFields = {} cipFields.inputQueryPattern = "input[type='text'], input[type='email'], input[type='password'], input[type='tel'], input[type='number'], input:not([type])"; // unique number as new IDs for input fields @@ -1682,7 +1687,7 @@ cip.rememberCredentials = function(usernameValue, passwordValue) { -cipEvents = {}; +var cipEvents = {}; cipEvents.clearCredentials = function() { cip.credentials = []; diff --git a/chromeKeePassXC/manifest.json b/chromeKeePassXC/manifest.json index f1e4b77..8998d8a 100644 --- a/chromeKeePassXC/manifest.json +++ b/chromeKeePassXC/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "chromeKeePassXC", - "version": "0.1.3", + "version": "0.1.4", "description": "KeePassXC integration for modern web browsers", "author": "Sami Vänttinen", "icons": { @@ -18,8 +18,10 @@ "default_title": "chromeKeePassXC", "default_popup": "popups/popup.html" }, - - "options_page": "options/options.html", + "options_ui": { + "page": "options/options.html", + "open_in_tab": true + }, "background": { "scripts": [ "background/nacl.min.js", diff --git a/chromeKeePassXC/options/options.js b/chromeKeePassXC/options/options.js index ce223a8..8e046d2 100644 --- a/chromeKeePassXC/options/options.js +++ b/chromeKeePassXC/options/options.js @@ -263,5 +263,5 @@ options.initSpecifiedCredentialFields = function() { } options.initAbout = function() { - $("#tab-about em.versionCIP").text(browser.app.getDetails().version); + $("#tab-about em.versionCIP").text(browser.runtime.getManifest().version); } diff --git a/chromeKeePassXC/popups/popup.js b/chromeKeePassXC/popups/popup.js index 85321cd..91eea2f 100644 --- a/chromeKeePassXC/popups/popup.js +++ b/chromeKeePassXC/popups/popup.js @@ -70,7 +70,7 @@ $(function() { }); }); - browser.runtime.sendMessage({ + chrome.runtime.sendMessage({ action: "get_status" }, status_response); }); \ No newline at end of file diff --git a/chromeKeePassXC/popups/popup_functions.js b/chromeKeePassXC/popups/popup_functions.js index dfcd4bc..ac50315 100644 --- a/chromeKeePassXC/popups/popup_functions.js +++ b/chromeKeePassXC/popups/popup_functions.js @@ -19,10 +19,8 @@ function updateAvailableResponse(available) { function initSettings() { $("#settings #btn-options").click(function() { + browser.runtime.openOptionsPage(); close(); - browser.tabs.create({ - url: "../options/options.html" - }) }); $("#settings #btn-choose-credential-fields").click(function() {