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

sites.js « common « keepassxc-browser - github.com/keepassxreboot/keepassxc-browser.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 77ab3e14bd2c2d07d8e73f757b0320bc9588c3c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
'use strict';

const PREDEFINED_SITELIST = [
    'https://accounts.google.com/*',
    'https://www.paypal.com/*/signin',
    'https://outlook.live.com/*',
    'https://login.live.com/*',
    'https://odc.officeapps.live.com/*',
    'https://login.microsoftonline.com/*',
    'https://www.amazon.ae/ap/*',
    'https://www.amazon.ca/ap/*',
    'https://www.amazon.cn/ap/*',
    'https://www.amazon.co.jp/ap/*',
    'https://www.amazon.co.uk/ap/*',
    'https://www.amazon.com/ap/*',
    'https://www.amazon.com.au/ap/*',
    'https://www.amazon.com.br/ap/*',
    'https://www.amazon.com.mx/ap/*',
    'https://www.amazon.com.tr/ap/*',
    'https://www.amazon.de/ap/*',
    'https://www.amazon.es/ap/*',
    'https://www.amazon.fr/ap/*',
    'https://www.amazon.in/ap/*',
    'https://www.amazon.it/ap/*',
    'https://www.amazon.nl/ap/*',
    'https://www.amazon.pl/ap/*',
    'https://www.amazon.sa/ap/*',
    'https://www.amazon.se/ap/*',
    'https://www.amazon.sg/ap/*',
    'https://signin.aws.amazon.com/*',
    'https://www.upwork.com/ab/*',
    'https://home.personalcapital.com/*',
    'https://auth.services.adobe.com/*',
    'https://idmsa.apple.com/*',
    'https://secure.soundcloud.com/*',
    'https://icloud.com/*',
    'https://signin.ebay.de/*',
    'https://signin.ebay.com/*',
    'https://signin.ebay.com.au/*',
    'https://signin.ebay.com.cn/*',
    'https://signin.ebay.com.hk/*',
    'https://signin.ebay.com.my/*',
    'https://signin.ebay.com.sg/*',
    'https://signin.ebay.it/*',
    'https://signin.ebay.co.uk/*',
    'https://signin.ebay.ca/*',
    'https://signin.ebay.at/*',
    'https://signin.ebay.be/*',
    'https://signin.ebay.fr/*',
    'https://signin.ebay.ie/*',
    'https://signin.ebay.nl/*',
    'https://signin.ebay.es/*',
    'https://signin.ebay.ch/*',
    'https://signin.ebay.in/*',
    'https://signin.ebay.ph/*',
    'https://login.yahoo.com/*',
    'https://id.atlassian.com/*',
    'https://www.fidelity.com/*'
];

const kpxcSites = {};
kpxcSites.ebayUrl = 'https://www.ebay.';
kpxcSites.googlePasswordFormUrl = 'https://accounts.google.com/signin/v2/challenge/password';
kpxcSites.googleUrl = 'https://accounts.google.com';
kpxcSites.savedForm = undefined;

/**
 * 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
 * @returns {boolean}           True if an Element has a match with the identifier and document location
 */
kpxcSites.exceptionFound = function(identifier) {
    if (!identifier || identifier.length === 0) {
        return;
    }

    if (document.location.origin === 'https://idmsa.apple.com'
        && [ 'password', 'form-row', 'show-password' ].every(c => identifier.contains(c))) {
        return true;
    } else if (document.location.origin.startsWith('https://signin.ebay.')
               && identifier.contains('null')) {
        return true;
    } else if (document.location.origin.startsWith('https://www.fidelity.com')
               && identifier.contains('fs-mask-username')) {
        return true;
    } else if (document.location.origin.startsWith('https://app.protonmail.ch')
              || document.location.origin.startsWith('https://mail.protonmail.com')
              && identifier === 'mailboxPassword') {
        return true;
    }

    return false;
};

kpxcSites.expectedTOTPMaxLength = function() {
    if (document.location.origin.startsWith('https://www.amazon')
        && document.location.href.includes('/ap/mfa')) {
        return 20;
    }

    return MAX_TOTP_INPUT_LENGTH;
};