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:
authorflo-mic <52607335+flo-mic@users.noreply.github.com>2021-02-25 18:25:49 +0300
committerGitHub <noreply@github.com>2021-02-25 18:25:49 +0300
commitb5508394ae99ad366f6b796871791293c23ac66c (patch)
tree9ded27c5ce57d0b8c0c9badc466b3bbc36b1a5e1
parent9e2dead569998d5897aad949f4beb64d1d88e41b (diff)
fix password 3 times detected issue
-rw-r--r--src/js/Miner/DomMiner.js31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/js/Miner/DomMiner.js b/src/js/Miner/DomMiner.js
index b4e20f1..989090c 100644
--- a/src/js/Miner/DomMiner.js
+++ b/src/js/Miner/DomMiner.js
@@ -3,6 +3,13 @@ import MessageService from '@js/Services/MessageService';
export default class DomMiner {
+ /**
+ *
+ */
+ constructor() {
+ this._knownForms = [];
+ }
+
init() {
window.addEventListener(
'beforeunload',
@@ -35,6 +42,27 @@ export default class DomMiner {
for(let form of forms) {
this._checkFormForPassword(form);
}
+ this._knownForms = [];
+ }
+
+ _checkForDuplication(form) {
+ var exists = false;
+ this._knownForms.forEach(element => {
+ if((element.pass == form.pass.value) &&
+ (element.user == form.user.value) &&
+ (element.url == this._getUrl())) {
+ exists = true;
+ }
+ });
+ if(exists === false) {
+ this._knownForms.push(
+ {
+ pass: form.pass.value,
+ user: form.user.value,
+ url: this._getUrl()
+ });
+ }
+ return exists;
}
/**
@@ -43,6 +71,7 @@ export default class DomMiner {
* @private
*/
_checkFormForPassword(form) {
+ if(this._checkForDuplication(form)) return;
if(form.pass.value.length !== 0 && form.pass.value.trim().length !== 0) {
let info = {
url : this._getUrl(),
@@ -151,4 +180,4 @@ export default class DomMiner {
return null;
}
-} \ No newline at end of file
+}