mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge branch 'develop'
This commit is contained in:
commit
e2a31e3ac0
7 changed files with 105 additions and 14 deletions
|
|
@ -1,4 +1,11 @@
|
|||
0.1.10 (2017-06.14)
|
||||
0.2.0 (2017-xx-xx)
|
||||
=========================
|
||||
- Added JSON install files and script for Windows
|
||||
- New version checking function
|
||||
- Added error message handling
|
||||
- Added support for reloading KeePassXC (or proxy) with new public keys
|
||||
|
||||
0.1.10 (2017-06-14)
|
||||
=========================
|
||||
- Updated manifest and json files up to date
|
||||
|
||||
|
|
|
|||
11
README.md
11
README.md
|
|
@ -6,6 +6,17 @@ For testing purposes, please use following unofficial KeePassXC [release's](http
|
|||
|
||||
Get the extension for [Firefox](https://addons.mozilla.org/en-US/firefox/addon/keepassxc-browser/) or [Chrome/Chromium](https://chrome.google.com/webstore/detail/keepassxc-browser/iopaggbpplllidnfmcghoonnokmjoicf).
|
||||
|
||||
## How it works
|
||||
There are two methods which you can use keepassxc-browser to connect to KeePassXC:
|
||||
|
||||
1. keepassxc-browser communicates directly with KeePassXC via stdin/stdout. This method launches KeePassXC every time you start the browser and closes when you exit.
|
||||
This can cause unsaved changes not to be saved. If you use this method it's important to enable `Automatically save after every change` from KeePassXC's preferences.
|
||||
|
||||
2. keepassxc-browser communicated with KeePassXC through [keepassxc-proxy](https://github.com/varjolintu/keepassxc-proxy). The proxy handles listening stdin/stdout
|
||||
and transfers these messages through a localhost UDP port 19700 (configurable) to KeePassXC. This means KeePassXC can be used and started normally without inteference from
|
||||
Native Messaging API. keepassxc-browser starts only the proxy application and there's no risk of shutting down KeePassXC or losing any unsaved changes. keepassxc-proxy
|
||||
is still under development. If you want, you are free to write your own proxy that handles the traffic.
|
||||
|
||||
## Protocol
|
||||
|
||||
Transmitting messages between KeePassXC and keepassxc-browser is totally rewritten. This is still under development.
|
||||
|
|
|
|||
10
com.varjolintu.keepassxc-browser-chrome-win.json
Normal file
10
com.varjolintu.keepassxc-browser-chrome-win.json
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"name": "com.varjolintu.keepassxc_browser",
|
||||
"description": "KeepassXC integration with Chrome with Native Messaging support",
|
||||
"path" : "keepassxc-proxy.bat",
|
||||
"type": "stdio",
|
||||
"allowed_origins": [
|
||||
"chrome-extension://iopaggbpplllidnfmcghoonnokmjoicf/",
|
||||
"chrome-extension://fhakpkpdnjecjfceboihdjpfmgajebii/"
|
||||
]
|
||||
}
|
||||
9
com.varjolintu.keepassxc-browser-firefox-win.json
Normal file
9
com.varjolintu.keepassxc-browser-firefox-win.json
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"name": "com.varjolintu.keepassxc_browser",
|
||||
"description": "KeepassXC integration with Firefox with Native Messaging support",
|
||||
"path" : "keepassxc-proxy.bat",
|
||||
"type": "stdio",
|
||||
"allowed_extensions": [
|
||||
"keepassxc-browser@sami.vanttinen"
|
||||
]
|
||||
}
|
||||
34
install.bat
Normal file
34
install.bat
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
:: Copyright 2014 The Chromium Authors. All rights reserved.
|
||||
:: Copyright 2017 Sami Vänttinen <sami.vanttinen@protonmail.com>
|
||||
:: Use of this source code is governed by a BSD-style license that can be
|
||||
:: found in the LICENSE file.
|
||||
:: Change HKCU to HKLM if you want to install globally.
|
||||
:: %~dp0 is the directory containing this bat script and ends with a backslash.
|
||||
@echo off
|
||||
echo.
|
||||
echo Select your browser:
|
||||
echo ====================
|
||||
echo 1) Chrome
|
||||
echo 2) Chromium
|
||||
echo 3) Firefox
|
||||
echo 4) Vivaldi
|
||||
set choice=
|
||||
set /p choice=1-4:
|
||||
if '%choice%'=='1' goto chrome
|
||||
if '%choice%'=='2' goto chromium
|
||||
if '%choice%'=='3' goto firefox
|
||||
if '%choice%'=='3' goto vivaldi
|
||||
goto end
|
||||
:chrome
|
||||
REG ADD "HKCU\Software\Google\Chrome\NativeMessagingHosts\com.varjolintu.keepassxc_browser" /ve /t REG_SZ /d "%~dp0com.varjolintu.keepassxc-browser-chrome.win.json" /f
|
||||
goto end
|
||||
:chromium
|
||||
REG ADD "HKCU\Software\Chromium\NativeMessagingHosts\com.varjolintu.keepassxc_browser" /ve /t REG_SZ /d "%~dp0com.varjolintu.keepassxc-browser-chrome.win.json" /f
|
||||
goto end
|
||||
:firefox
|
||||
REG ADD "HKCU\Software\Mozilla\NativeMessagingHosts\com.varjolintu.keepassxc_browser" /ve /t REG_SZ /d "%~dp0com.varjolintu.keepassxc-browser-firefox.win.json" /f
|
||||
goto end
|
||||
:vivaldi
|
||||
REG ADD "HKCU\Software\Vivaldi\NativeMessagingHosts\com.varjolintu.keepassxc_browser" /ve /t REG_SZ /d "%~dp0com.varjolintu.keepassxc-browser-chrome.win.json" /f
|
||||
goto end
|
||||
:end
|
||||
|
|
@ -9,11 +9,12 @@ keepass.isKeePassXCAvailable = false;
|
|||
keepass.isEncryptionKeyUnrecognized = false;
|
||||
keepass.currentKeePassXC = {"version": 0, "versionParsed": 0};
|
||||
keepass.latestKeePassXC = (typeof(localStorage.latestKeePassXC) == 'undefined') ? {"version": 0, "versionParsed": 0, "lastChecked": null} : JSON.parse(localStorage.latestKeePassXC);
|
||||
keepass.requiredKeePassXC = 214;
|
||||
keepass.requiredKeePassXC = 220;
|
||||
keepass.nativeHostName = "com.varjolintu.keepassxc_browser";
|
||||
keepass.nativePort = null;
|
||||
keepass.keySize = 24;
|
||||
keepass.latestVersionUrl = "https://raw.githubusercontent.com/keepassxreboot/keepassxc/develop/CHANGELOG";
|
||||
keepass.proxyPort = 19700;
|
||||
keepass.latestVersionUrl = "https://api.github.com/repos/keepassxreboot/keepassxc/releases/latest";
|
||||
keepass.cacheTimeout = 30 * 1000; // milliseconds
|
||||
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);
|
||||
|
|
@ -93,6 +94,9 @@ keepass.updateCredentials = function(callback, tab, entryId, username, password,
|
|||
callback(code);
|
||||
}
|
||||
}
|
||||
else if (response.error && response.errorCode) {
|
||||
keepass.handleError(tab.id, response.error, response.errorCode);
|
||||
}
|
||||
else {
|
||||
browserAction.showDefault(null, tab);
|
||||
}
|
||||
|
|
@ -172,6 +176,9 @@ keepass.retrieveCredentials = function (callback, tab, url, submiturl, forceCall
|
|||
page.debug("keepass.retrieveCredentials() => entries.length = {1}", entries.length);
|
||||
}
|
||||
}
|
||||
else if (response.error && response.errorCode) {
|
||||
keepass.handleError(tab.id, response.error, response.errorCode);
|
||||
}
|
||||
else {
|
||||
browserAction.showDefault(null, tab);
|
||||
}
|
||||
|
|
@ -252,6 +259,9 @@ keepass.generatePassword = function (callback, tab, forceCallback) {
|
|||
callback(passwords);
|
||||
}
|
||||
}
|
||||
else if (response.error && response.errorCode) {
|
||||
keepass.handleError(tab.id, response.error, response.errorCode);
|
||||
}
|
||||
});
|
||||
keepass.nativePort.postMessage(request);
|
||||
}, tab);
|
||||
|
|
@ -333,6 +343,9 @@ keepass.associate = function(callback, tab) {
|
|||
browserAction.show(callback, tab);
|
||||
}
|
||||
}
|
||||
else if (response.error && response.errorCode) {
|
||||
keepass.handleError(tab.id, response.error, response.errorCode);
|
||||
}
|
||||
});
|
||||
keepass.nativePort.postMessage(request);
|
||||
}, tab);
|
||||
|
|
@ -432,6 +445,9 @@ keepass.testAssociation = function (callback, tab, triggerUnlock) {
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (response.error && response.errorCode) {
|
||||
keepass.handleError(tab.id, response.error, response.errorCode);
|
||||
}
|
||||
callback(keepass.isAssociated());
|
||||
});
|
||||
keepass.nativePort.postMessage(request);
|
||||
|
|
@ -500,6 +516,7 @@ keepass.changePublicKeys = function(tab, callback) {
|
|||
var message = {
|
||||
"action": "change-public-keys",
|
||||
"publicKey": key,
|
||||
"proxyPort": keepass.proxyPort,
|
||||
"nonce": nonce
|
||||
}
|
||||
|
||||
|
|
@ -620,23 +637,21 @@ keepass.keePassXCUpdateAvailable = function() {
|
|||
|
||||
keepass.checkForNewKeePassXCVersion = function() {
|
||||
var xhr = new XMLHttpRequest();
|
||||
var version = -1;
|
||||
xhr.open("GET", keepass.latestVersionUrl, true);
|
||||
xhr.onload = function(e) {
|
||||
if (xhr.readyState == 4) {
|
||||
if (xhr.status == 200) {
|
||||
var $version = xhr.responseText;
|
||||
if ($version.substring(0, 1) == "2") {
|
||||
$version = $version.substring(0, $version.indexOf(" "));
|
||||
keepass.latestKeePassXC.version = $version;
|
||||
keepass.latestKeePassXC.versionParsed = parseInt($version.replace(/\./g,""));
|
||||
var json = JSON.parse(xhr.responseText);
|
||||
if (json.tag_name) {
|
||||
version = json.tag_name;
|
||||
keepass.latestKeePassXC.version = version;
|
||||
keepass.latestKeePassXC.versionParsed = parseInt(version.replace(/\./g,""));
|
||||
}
|
||||
}
|
||||
else {
|
||||
$version = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($version != -1) {
|
||||
if (version != -1) {
|
||||
localStorage.latestKeePassXC = JSON.stringify(keepass.latestKeePassXC);
|
||||
}
|
||||
};
|
||||
|
|
@ -727,6 +742,11 @@ keepass.verifyResponse = function(response, nonce, id) {
|
|||
|
||||
}
|
||||
|
||||
keepass.handleError = function(tabId, errorMessage, errorCode) {
|
||||
console.log("Received error " + errorCode + ": " + errorMessage);
|
||||
page.tabs[tabId].errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
keepass.b64e = function(d) {
|
||||
return nacl.util.encodeBase64(d);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "keepassxc-browser",
|
||||
"version": "0.1.10",
|
||||
"version": "0.2.0",
|
||||
"description": "KeePassXC integration for modern web browsers",
|
||||
"author": "Sami Vänttinen",
|
||||
"icons": {
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
"applications": {
|
||||
"gecko": {
|
||||
"id": "keepassxc-browser@sami.vanttinen",
|
||||
"strict_min_version": "53.0"
|
||||
"strict_min_version": "56.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue