mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge pull request #1993 from keepassxreboot/fix/add_patreon_to_predefined_sites
Add Patreon to Predefined Sites
This commit is contained in:
commit
cba1010811
2 changed files with 7 additions and 3 deletions
|
|
@ -29,7 +29,8 @@ const PREDEFINED_SITELIST = [
|
|||
'https://twitter.com/i/flow/login',
|
||||
'https://login3.id.hp.com/*',
|
||||
'https://secure.fnac.com/identity/server/gateway/*',
|
||||
'https://*.openai.com/u/login/*'
|
||||
'https://*.openai.com/u/login/*',
|
||||
'https://www.patreon.com/login'
|
||||
];
|
||||
|
||||
const awsUrl = 'signin.aws.amazon.com';
|
||||
|
|
@ -58,9 +59,10 @@ kpxcSites.detectUsernameFromPage = function() {
|
|||
* Handles a few exceptions for certain sites where password form is inside a div
|
||||
* or another element that is not detected directly. Triggered by MutationObserver.
|
||||
* @param {string} identifier Usually a classList or element id
|
||||
* @param {object} field The target element
|
||||
* @returns {boolean} True if an Element has a match with the identifier and document location
|
||||
*/
|
||||
kpxcSites.exceptionFound = function(identifier) {
|
||||
kpxcSites.exceptionFound = function(identifier, field) {
|
||||
if (!identifier || identifier.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -82,6 +84,8 @@ kpxcSites.exceptionFound = function(identifier) {
|
|||
|| document.location.origin.startsWith('https://mail.protonmail.com')
|
||||
&& identifier === 'mailboxPassword') {
|
||||
return true;
|
||||
} else if (document.location.origin === 'https://www.patreon.com' && field?.name === 'current-password') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ kpxcObserverHelper.initObserver = async function() {
|
|||
} else if (mut.type === 'attributes' && (mut.attributeName === 'class' || mut.attributeName === 'style')) {
|
||||
// Only accept targets with forms
|
||||
const forms = mut.target.nodeName === 'FORM' ? mut.target : mut.target.getElementsByTagName('form');
|
||||
if (forms.length === 0 && !kpxcSites.exceptionFound(mut.target.classList)) {
|
||||
if (forms.length === 0 && !kpxcSites.exceptionFound(mut.target.classList, mut.target)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue