Skip to content

Commit 75bf977

Browse files
author
Sami Vänttinen
authored
Merge pull request #1445 from keepassxreboot/fix/add_twitter_to_predefined_sites
Add Twitter to Predefined Sites
2 parents e69135f + c57cb92 commit 75bf977

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

keepassxc-browser/common/sites.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ const PREDEFINED_SITELIST = [
5555
'https://signin.ebay.ph/*',
5656
'https://login.yahoo.com/*',
5757
'https://id.atlassian.com/*',
58-
'https://www.fidelity.com/*'
58+
'https://www.fidelity.com/*',
59+
'https://twitter.com/i/flow/login'
5960
];
6061

6162
const kpxcSites = {};
@@ -97,6 +98,25 @@ kpxcSites.exceptionFound = function(identifier) {
9798
return false;
9899
};
99100

101+
/**
102+
* Handles a few exceptions for certain sites where 2FA field is not regognized properly.
103+
* @param {object} field Input field Element
104+
* @returns {boolean} True if an Element has a match with the needed indentfifiers and document location
105+
*/
106+
kpxcSites.totpExceptionFound = function(field) {
107+
if (!field || field.nodeName !== 'INPUT') {
108+
return false;
109+
}
110+
111+
if (document.location.href === 'https://twitter.com/i/flow/login'
112+
&& field.autocomplete === 'on' && field.dir === 'auto'
113+
&& field.name === 'text' && field.type === 'text') {
114+
return true;
115+
}
116+
117+
return false;
118+
};
119+
100120
kpxcSites.expectedTOTPMaxLength = function() {
101121
if (document.location.origin.startsWith('https://www.amazon')
102122
&& document.location.href.includes('/ap/mfa')) {

keepassxc-browser/content/totp-field.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ kpxcTOTPIcons.isAcceptedTOTPField = function(field) {
5252
return true;
5353
}
5454

55+
if (kpxcSites.totpExceptionFound(field)) {
56+
return true;
57+
}
58+
5559
return false;
5660
};
5761

0 commit comments

Comments
 (0)