Fixed Skip button function when choosing own credential fields

This commit is contained in:
varjolintu 2017-07-30 21:23:42 +03:00
parent 9f030df327
commit 0144b7e2dd
6 changed files with 31 additions and 22 deletions

View file

@ -1,6 +1,7 @@
0.2.7 (2017-??-??)
=========================
- Some Firefox related changes (credits to projectgus)
- Fixed Skip button function when choosing own credential fields
0.2.6 (2017-07-23)
=========================

View file

@ -7,12 +7,6 @@ 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).
If you want to use the extension manually with the latest stable build of Firefox, you can do the following:
- Install [Firefox Nightly](https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly)
- Download the .crx file from [releases](https://github.com/varjolintu/keepassxc-browser/releases)
- Drag the .crx to the Firefox's Add-ons page (about:addons)
- Close Firefox Nightly and start the stable Firefox. The add-on should be now installed
## How it works
There are two methods which you can use keepassxc-browser to connect to KeePassXC:

View file

@ -611,16 +611,14 @@ keepass.keePassXCUpdateAvailable = function() {
keepass.checkForNewKeePassXCVersion = function() {
let xhr = new XMLHttpRequest();
let version = -1;
xhr.open('GET', keepass.latestVersionUrl, true);
xhr.onload = function(e) {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
const json = JSON.parse(xhr.responseText);
if (json.tag_name) {
version = json.tag_name;
keepass.latestKeePassXC.version = version;
keepass.latestKeePassXC.versionParsed = Number(version.replace(/\./g, ''));
}
if (xhr.readyState === 4 && xhr.status === 200) {
const json = JSON.parse(xhr.responseText);
if (json.tag_name) {
version = json.tag_name;
keepass.latestKeePassXC.version = version;
keepass.latestKeePassXC.versionParsed = Number(version.replace(/\./g, ''));
}
}
@ -633,7 +631,13 @@ keepass.checkForNewKeePassXCVersion = function() {
console.log('checkForNewKeePassXCVersion error:' + e);
}
xhr.send();
try {
xhr.open('GET', keepass.latestVersionUrl, true);
xhr.send();
}
catch (ex) {
console.log(ex);
}
keepass.latestKeePassXC.lastChecked = new Date();
}

View file

@ -562,12 +562,12 @@ cipDefine.initDescription = function() {
.addClass('btn').addClass('btn-info')
.css('margin-right', '5px')
.click(function() {
if (jQuery(this).data('step') === 1) {
if (jQuery(this).data('step') === '1') {
cipDefine.selection.username = null;
cipDefine.prepareStep2();
cipDefine.markAllPasswordFields(jQuery('#b2c-cipDefine-fields'));
}
else if (jQuery(this).data('step') === 2) {
else if (jQuery(this).data('step') === '2') {
cipDefine.selection.password = null;
cipDefine.prepareStep3();
cipDefine.markAllStringFields(jQuery('#b2c-cipDefine-fields'));

View file

@ -36,9 +36,19 @@
},
"content_scripts": [
{
"matches": [ "http://*/*", "https://*/*" ],
"js": [ "jquery-3.2.1.min.js", "jquery-ui.min.js", "keepassxc-browser.js" ],
"css": [ "jquery-ui.min.css", "keepassxc-browser.css" ],
"matches": [
"http://*/*",
"https://*/*"
],
"js": [
"jquery-3.2.1.min.js",
"jquery-ui.min.js",
"keepassxc-browser.js"
],
"css": [
"jquery-ui.min.css",
"keepassxc-browser.css"
],
"run_at": "document_idle",
"all_frames": true
}

View file

@ -55,7 +55,7 @@ $(function() {
});
$('#redetect-fields-button').click(function() {
browser.tabs.query({'active': true, 'windowId': browser.windows.WINDOW_ID_CURRENT}, (tabs) => {
browser.tabs.query({"active": true, "currentWindow": true}, (tabs) => {
if (tabs.length === 0)
return; // For example: only the background devtools or a popup are opened
let tab = tabs[0];