Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marius-wieschollek/passwords-webextension.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius David Wieschollek <passwords.public@mdns.eu>2021-12-15 00:03:28 +0300
committerMarius David Wieschollek <passwords.public@mdns.eu>2021-12-15 00:03:28 +0300
commit1b5db816ae2e81191418c93dcaf2ce1ba83232cf (patch)
treeb3fe911f138fb5ecadc89afe0f0e53d9f004eba4
parentb6d84a7454434a4200f9ff433c271d36501ab98b (diff)
parentccf33f8cdab77cc4a0c0d1979090898977863ae5 (diff)
Merge branch 'master' into testing
-rw-r--r--package-lock.json16
-rw-r--r--package.json2
-rw-r--r--src/js/Controller/Client/FillPassword.js2
-rw-r--r--src/js/Helper/ServerRequirementCheck.js2
-rw-r--r--src/js/Manager/AutofillManager.js7
-rw-r--r--src/js/Manager/ContextMenuManager.js23
-rw-r--r--src/js/Queue/Client/AuthorisationClient.js10
-rw-r--r--src/js/Services/PopupStateService.js23
-rw-r--r--src/platform/chrome/manifest.json4
-rw-r--r--src/platform/fenix/manifest.json2
-rw-r--r--src/platform/firefox/manifest.json2
-rw-r--r--src/vue/App/Popup.vue13
-rw-r--r--src/vue/Components/Popup/Authorisation.vue37
13 files changed, 89 insertions, 54 deletions
diff --git a/package-lock.json b/package-lock.json
index fca450f..6399c73 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "passwords-webextension",
- "version": "2.2.0",
+ "version": "2.2.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "passwords-webextension",
- "version": "2.2.0",
+ "version": "2.2.2",
"license": "GPL",
"devDependencies": {
"@fortawesome/fontawesome-free": "^5.15.4",
@@ -2440,9 +2440,9 @@
}
},
"node_modules/postcss": {
- "version": "8.4.4",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.4.tgz",
- "integrity": "sha512-joU6fBsN6EIer28Lj6GDFoC/5yOZzLCfn0zHAn/MYXI7aPt4m4hK5KC5ovEZXy+lnCjmYIbQWngvju2ddyEr8Q==",
+ "version": "8.4.5",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.5.tgz",
+ "integrity": "sha512-jBDboWM8qpaqwkMwItqTQTiFikhs/67OYVvblFFTM7MrZjt6yMKd6r2kgXizEbTTljacm4NldIlZnhbjr84QYg==",
"dev": true,
"dependencies": {
"nanoid": "^3.1.30",
@@ -5918,9 +5918,9 @@
}
},
"postcss": {
- "version": "8.4.4",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.4.tgz",
- "integrity": "sha512-joU6fBsN6EIer28Lj6GDFoC/5yOZzLCfn0zHAn/MYXI7aPt4m4hK5KC5ovEZXy+lnCjmYIbQWngvju2ddyEr8Q==",
+ "version": "8.4.5",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.5.tgz",
+ "integrity": "sha512-jBDboWM8qpaqwkMwItqTQTiFikhs/67OYVvblFFTM7MrZjt6yMKd6r2kgXizEbTTljacm4NldIlZnhbjr84QYg==",
"dev": true,
"requires": {
"nanoid": "^3.1.30",
diff --git a/package.json b/package.json
index d03022d..c61a2bd 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "passwords-webextension",
- "version": "2.2.1",
+ "version": "2.2.2",
"description": "The official browser client of the Passwords app for Nextcloud",
"private": true,
"scripts": {
diff --git a/src/js/Controller/Client/FillPassword.js b/src/js/Controller/Client/FillPassword.js
index 446d95f..4c2a488 100644
--- a/src/js/Controller/Client/FillPassword.js
+++ b/src/js/Controller/Client/FillPassword.js
@@ -56,7 +56,7 @@ export default class FillPassword extends AbstractController {
*/
_fillCustomForms(formFields) {
formFields.forEach((field) => {
- var element = document.getElementById(field.id);
+ let element = document.getElementById(field.id);
if(element !== null && element !== undefined) {
if(!element.readOnly && !element.disabled && !element.hidden) {
this._insertTextIntoField(element, field.value);
diff --git a/src/js/Helper/ServerRequirementCheck.js b/src/js/Helper/ServerRequirementCheck.js
index e1d7f5d..eceef09 100644
--- a/src/js/Helper/ServerRequirementCheck.js
+++ b/src/js/Helper/ServerRequirementCheck.js
@@ -8,7 +8,7 @@ import ConnectionErrorHelper from '@js/Helper/ConnectionErrorHelper';
export default class ServerRequirementCheck {
get MINIMUM_APP_VERSION() {
- return [2021, 12];
+ return [2021, 1];
}
/**
diff --git a/src/js/Manager/AutofillManager.js b/src/js/Manager/AutofillManager.js
index 390638c..e4238d6 100644
--- a/src/js/Manager/AutofillManager.js
+++ b/src/js/Manager/AutofillManager.js
@@ -76,11 +76,11 @@ export default new class AutofillManager {
*
* @param {Password} password
* @returns {Array}
- * @private
*/
getCustomFormFields(password) {
- var formFields = [];
- var customFields = password.getCustomFields();
+ let formFields = [],
+ customFields = password.getCustomFields();
+
customFields._elements.forEach((e) => {
if(e.getType() === 'data' && e.getLabel().startsWith('ext:field/')) {
formFields.push(
@@ -91,6 +91,7 @@ export default new class AutofillManager {
);
}
});
+
return formFields;
}
};
diff --git a/src/js/Manager/ContextMenuManager.js b/src/js/Manager/ContextMenuManager.js
index 940c70e..0b6a7fb 100644
--- a/src/js/Manager/ContextMenuManager.js
+++ b/src/js/Manager/ContextMenuManager.js
@@ -1,12 +1,13 @@
-import SystemService from '@js/Services/SystemService';
+import SystemService from '@js/Services/SystemService';
import RecommendationManager from '@js/Manager/RecommendationManager';
-import LocalisationService from '@js/Services/LocalisationService';
-import { v4 as uuid } from 'uuid';
-import MessageService from '@js/Services/MessageService';
-import TabManager from '@js/Manager/TabManager';
-import ErrorManager from "@js/Manager/ErrorManager";
-import ThemeService from "@js/Services/ThemeService";
-import BlobToBase64Helper from "@js/Helper/BlobToBase64Helper";
+import LocalisationService from '@js/Services/LocalisationService';
+import {v4 as uuid} from 'uuid';
+import MessageService from '@js/Services/MessageService';
+import TabManager from '@js/Manager/TabManager';
+import ErrorManager from '@js/Manager/ErrorManager';
+import ThemeService from '@js/Services/ThemeService';
+import BlobToBase64Helper from '@js/Helper/BlobToBase64Helper';
+import AutofillManager from '@js/Manager/AutofillManager';
class ContextMenuManager {
@@ -146,8 +147,10 @@ class ContextMenuManager {
channel : 'tabs',
tab : TabManager.currentTabId,
payload : {
- user : password.getUserName(),
- password: password.getPassword()
+ user : password.getUserName(),
+ password : password.getPassword(),
+ formFields: AutofillManager.getCustomFormFields(password),
+ submit : false
}
}
);
diff --git a/src/js/Queue/Client/AuthorisationClient.js b/src/js/Queue/Client/AuthorisationClient.js
index 5066d0c..918b256 100644
--- a/src/js/Queue/Client/AuthorisationClient.js
+++ b/src/js/Queue/Client/AuthorisationClient.js
@@ -1,6 +1,6 @@
-import Popup from '@js/App/Popup';
import AuthorisationItem from '@js/Models/Queue/AuthorisationItem';
-import FeedbackClient from '@js/Queue/Client/FeedbackClient';
+import FeedbackClient from '@js/Queue/Client/FeedbackClient';
+import PopupStateService from '@js/Services/PopupStateService';
export default class AuthorisationClient extends FeedbackClient {
@@ -61,7 +61,7 @@ export default class AuthorisationClient extends FeedbackClient {
reject
};
- if(Popup.app) Popup.app.authorized = false;
+ PopupStateService.setStatus('authorized', false);
});
}
@@ -87,7 +87,7 @@ export default class AuthorisationClient extends FeedbackClient {
resolve();
if(Object.keys(this._items).length === 0) {
- if(Popup.app) Popup.app.authorized = true;
+ PopupStateService.setStatus('authorized', true);
}
return;
@@ -100,7 +100,7 @@ export default class AuthorisationClient extends FeedbackClient {
reject
};
- if(Popup.app) Popup.app.authorized = false;
+ PopupStateService.setStatus('authorized', false);
});
}
} \ No newline at end of file
diff --git a/src/js/Services/PopupStateService.js b/src/js/Services/PopupStateService.js
index 2254deb..24113df 100644
--- a/src/js/Services/PopupStateService.js
+++ b/src/js/Services/PopupStateService.js
@@ -1,12 +1,23 @@
import MessageService from "@js/Services/MessageService";
-import ErrorManager from "@js/Manager/ErrorManager";
+import ErrorManager from "@js/Manager/ErrorManager";
+import EventQueue from '@js/Event/EventQueue';
export default new class PopupStateService {
+ get change() {
+ return this._dataEvents;
+ }
+
+ get status() {
+ return this._statusEvents;
+ }
+
constructor() {
this._tab = 'related';
this._data = {};
this._status = {};
+ this._dataEvents = new EventQueue();
+ this._statusEvents = new EventQueue();
this._defaults = {
'search.query': ''
@@ -56,6 +67,15 @@ export default new class PopupStateService {
}
/**
+ * @param {String} key
+ * @param {*} value
+ */
+ setStatus(key, value) {
+ this._status[key] = [value];
+ this._statusEvents.emit({key, value});
+ }
+
+ /**
* @param {(String|String[])} key
* @param {(String|null)} [tab=null]
* @returns {*}
@@ -133,6 +153,7 @@ export default new class PopupStateService {
if(tab === null) tab = this._tab;
if(!this._data.hasOwnProperty(tab)) this._data[tab] = {};
this._data[tab][key] = value;
+ this._dataEvents.emit({tab, key, value});
}
/**
diff --git a/src/platform/chrome/manifest.json b/src/platform/chrome/manifest.json
index ffd1eed..5cbf752 100644
--- a/src/platform/chrome/manifest.json
+++ b/src/platform/chrome/manifest.json
@@ -1,8 +1,8 @@
{
"manifest_version" : 2,
"name" : "__MSG_extensionName__",
- "version" : "2.2.1.99999",
- "version_name" : "2.2.1",
+ "version" : "2.2.2.99999",
+ "version_name" : "2.2.2",
"description" : "__MSG_extensionDescription__",
"author" : "Marius Wieschollek",
"default_locale" : "en",
diff --git a/src/platform/fenix/manifest.json b/src/platform/fenix/manifest.json
index 99a20d9..aee4729 100644
--- a/src/platform/fenix/manifest.json
+++ b/src/platform/fenix/manifest.json
@@ -1,7 +1,7 @@
{
"manifest_version" : 2,
"name" : "__MSG_extensionName__",
- "version" : "2.2.1.BUILD",
+ "version" : "2.2.2.BUILD",
"description" : "__MSG_extensionDescription__",
"author" : "Marius Wieschollek",
"default_locale" : "en",
diff --git a/src/platform/firefox/manifest.json b/src/platform/firefox/manifest.json
index 03e3926..fc10663 100644
--- a/src/platform/firefox/manifest.json
+++ b/src/platform/firefox/manifest.json
@@ -1,7 +1,7 @@
{
"manifest_version" : 2,
"name" : "__MSG_extensionName__",
- "version" : "2.2.1.BUILD",
+ "version" : "2.2.2.BUILD",
"description" : "__MSG_extensionDescription__",
"author" : "Marius Wieschollek",
"default_locale" : "en",
diff --git a/src/vue/App/Popup.vue b/src/vue/App/Popup.vue
index aaf5fb8..b9e19f3 100644
--- a/src/vue/App/Popup.vue
+++ b/src/vue/App/Popup.vue
@@ -47,6 +47,16 @@
}
},
+ data() {
+ PopupStateService.status.on((data) => {
+ if(data.key === 'authorized') this.authorized = data.value;
+ });
+
+ return {
+ authorized: PopupStateService.getStatus('authorized')
+ }
+ },
+
computed: {
tab() {
return PopupStateService.getTab();
@@ -54,9 +64,6 @@
firstRun() {
return PopupStateService.getStatus('firstRun');
},
- authorized() {
- return PopupStateService.getStatus('authorized');
- },
tabs() {
return {
related : {
diff --git a/src/vue/Components/Popup/Authorisation.vue b/src/vue/Components/Popup/Authorisation.vue
index 3f83ff9..f7eb8c0 100644
--- a/src/vue/Components/Popup/Authorisation.vue
+++ b/src/vue/Components/Popup/Authorisation.vue
@@ -36,15 +36,16 @@
</template>
<script>
- import MessageService from '@js/Services/MessageService';
- import Translate from '@vue/Components/Translate';
- import Icon from '@vue/Components/Icon';
- import Popup from '@js/App/Popup';
- import ToastService from '@js/Services/ToastService';
- import InputField from '@vue/Components/Form/InputField';
- import ButtonField from '@vue/Components/Form/ButtonField';
- import SelectField from '@vue/Components/Form/SelectField';
- import ErrorManager from '@js/Manager/ErrorManager';
+ import MessageService from '@js/Services/MessageService';
+ import Translate from '@vue/Components/Translate';
+ import Icon from '@vue/Components/Icon';
+ import Popup from '@js/App/Popup';
+ import ToastService from '@js/Services/ToastService';
+ import InputField from '@vue/Components/Form/InputField';
+ import ButtonField from '@vue/Components/Form/ButtonField';
+ import SelectField from '@vue/Components/Form/SelectField';
+ import ErrorManager from '@js/Manager/ErrorManager';
+ import PopupStateService from '@js/Services/PopupStateService';
export default {
components: {SelectField, ButtonField, InputField, Icon, Translate},
@@ -114,7 +115,7 @@
this.focus();
});
} else {
- this.$parent.authorized = true;
+ PopupStateService.setStatus('authorized', true);
}
},
focus() {
@@ -202,21 +203,23 @@
watch: {
provider(value) {
- let provider = this.getProvider(value);
- if(provider) {
- this.tokenField = provider.hasInput;
- this.tokenRequest = provider.hasRequest;
+ if(value) {
+ let provider = this.getProvider(value);
+ if(provider) {
+ this.tokenField = provider.hasInput;
+ this.tokenRequest = provider.hasRequest;
+ }
}
this.token = null;
- this.authRequest.setProvider(value);
+ if(this.authRequest) this.authRequest.setProvider(value);
if(this.tokenRequest && value) this.requestToken();
},
token(value) {
- this.authRequest.setToken(value);
+ if(this.authRequest) this.authRequest.setToken(value);
},
password(value) {
- this.authRequest.setPassword(value);
+ if(this.authRequest) this.authRequest.setPassword(value);
}
}
};