Merge pull request #1445 from keepassxreboot/fix/add_twitter_to_predefined_sites

Add Twitter to Predefined Sites
This commit is contained in:
Sami Vänttinen 2021-11-15 21:39:40 +02:00 committed by GitHub
commit 75bf977e63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 1 deletions

View file

@ -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')) {

View file

@ -52,6 +52,10 @@ kpxcTOTPIcons.isAcceptedTOTPField = function(field) {
return true;
}
if (kpxcSites.totpExceptionFound(field)) {
return true;
}
return false;
};