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

github.com/keepassxreboot/keepassxc-browser.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSami Vänttinen <sami.vanttinen@protonmail.com>2021-11-15 22:39:40 +0300
committerGitHub <noreply@github.com>2021-11-15 22:39:40 +0300
commit75bf977e6349f8802006f088fc398d69b67476a7 (patch)
tree732e761a37234816347ae86191722fc1b427184c
parente69135ff6ac659dcdd2dc1562f7d7cf309d16b45 (diff)
parentc57cb92f3e590ee6f6c5955ecd25a180a040542b (diff)
Merge pull request #1445 from keepassxreboot/fix/add_twitter_to_predefined_sites1.7.10
Add Twitter to Predefined Sites
-rw-r--r--keepassxc-browser/common/sites.js22
-rw-r--r--keepassxc-browser/content/totp-field.js4
2 files changed, 25 insertions, 1 deletions
diff --git a/keepassxc-browser/common/sites.js b/keepassxc-browser/common/sites.js
index 241c2fd..0037501 100644
--- a/keepassxc-browser/common/sites.js
+++ b/keepassxc-browser/common/sites.js
@@ -55,7 +55,8 @@ const PREDEFINED_SITELIST = [
'https://signin.ebay.ph/*',
'https://login.yahoo.com/*',
'https://id.atlassian.com/*',
- 'https://www.fidelity.com/*'
+ 'https://www.fidelity.com/*',
+ 'https://twitter.com/i/flow/login'
];
const kpxcSites = {};
@@ -97,6 +98,25 @@ kpxcSites.exceptionFound = function(identifier) {
return false;
};
+/**
+ * Handles a few exceptions for certain sites where 2FA field is not regognized properly.
+ * @param {object} field Input field Element
+ * @returns {boolean} True if an Element has a match with the needed indentfifiers and document location
+ */
+kpxcSites.totpExceptionFound = function(field) {
+ if (!field || field.nodeName !== 'INPUT') {
+ return false;
+ }
+
+ if (document.location.href === 'https://twitter.com/i/flow/login'
+ && field.autocomplete === 'on' && field.dir === 'auto'
+ && field.name === 'text' && field.type === 'text') {
+ return true;
+ }
+
+ return false;
+};
+
kpxcSites.expectedTOTPMaxLength = function() {
if (document.location.origin.startsWith('https://www.amazon')
&& document.location.href.includes('/ap/mfa')) {
diff --git a/keepassxc-browser/content/totp-field.js b/keepassxc-browser/content/totp-field.js
index 0d15dde..9dbb1ec 100644
--- a/keepassxc-browser/content/totp-field.js
+++ b/keepassxc-browser/content/totp-field.js
@@ -52,6 +52,10 @@ kpxcTOTPIcons.isAcceptedTOTPField = function(field) {
return true;
}
+ if (kpxcSites.totpExceptionFound(field)) {
+ return true;
+ }
+
return false;
};