summaryrefslogtreecommitdiffstats
path: root/toolkit/components/formautofill/Constants.ios.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /toolkit/components/formautofill/Constants.ios.mjs
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--toolkit/components/formautofill/Constants.ios.mjs102
1 files changed, 102 insertions, 0 deletions
diff --git a/toolkit/components/formautofill/Constants.ios.mjs b/toolkit/components/formautofill/Constants.ios.mjs
new file mode 100644
index 0000000000..619c1b9aad
--- /dev/null
+++ b/toolkit/components/formautofill/Constants.ios.mjs
@@ -0,0 +1,102 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+const IOS_DEFAULT_PREFERENCES = {
+ "extensions.formautofill.creditCards.heuristics.mode": 1,
+ "extensions.formautofill.creditCards.heuristics.fathom.confidenceThreshold": 0.5,
+ "extensions.formautofill.creditCards.heuristics.fathom.highConfidenceThreshold": 0.95,
+ "extensions.formautofill.creditCards.heuristics.fathom.testConfidence": 0,
+ "extensions.formautofill.creditCards.heuristics.fathom.types":
+ "cc-number,cc-name",
+ "extensions.formautofill.loglevel": "Warn",
+ "extensions.formautofill.firstTimeUse": true,
+ "extensions.formautofill.addresses.supported": "off",
+ "extensions.formautofill.creditCards.supported": "detect",
+ "browser.search.region": "US",
+ "extensions.formautofill.creditCards.supportedCountries": "US,CA,GB,FR,DE",
+ "extensions.formautofill.addresses.enabled": false,
+ "extensions.formautofill.addresses.capture.enabled": false,
+ "extensions.formautofill.addresses.capture.v2.enabled": false,
+ "extensions.formautofill.addresses.supportedCountries": "",
+ "extensions.formautofill.creditCards.enabled": true,
+ "extensions.formautofill.reauth.enabled": true,
+ "extensions.formautofill.creditCards.hideui": false,
+ "extensions.formautofill.supportRTL": false,
+ "extensions.formautofill.creditCards.ignoreAutocompleteOff": true,
+ "extensions.formautofill.addresses.ignoreAutocompleteOff": true,
+ "extensions.formautofill.heuristics.enabled": true,
+ "extensions.formautofill.section.enabled": true,
+ // WebKit doesn't support the checkVisibility API, setting the threshold value to 0 to esnure
+ // `IsFieldVisible` function doesn't use it
+ "extensions.formautofill.heuristics.visibilityCheckThreshold": 0,
+ "extensions.formautofill.focusOnAutofill": false,
+};
+
+// Used Mimic the behavior of .getAutocompleteInfo()
+// List from: https://searchfox.org/mozilla-central/source/dom/base/AutocompleteFieldList.h#89-149
+// Also found here: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete
+const VALID_AUTOCOMPLETE_FIELDS = [
+ "off",
+ "on",
+ "name",
+ "honorific-prefix",
+ "given-name",
+ "additional-name",
+ "family-name",
+ "honorific-suffix",
+ "nickname",
+ "email",
+ "username",
+ "new-password",
+ "current-password",
+ "one-time-code",
+ "organization-title",
+ "organization",
+ "street-address",
+ "address-line1",
+ "address-line2",
+ "address-line3",
+ "address-level4",
+ "address-level3",
+ "address-level2",
+ "address-level1",
+ "country",
+ "country-name",
+ "postal-code",
+ "cc-name",
+ "cc-given-name",
+ "cc-additional-name",
+ "cc-family-name",
+ "cc-number",
+ "cc-exp",
+ "cc-exp-month",
+ "cc-exp-year",
+ "cc-csc",
+ "cc-type",
+ "transaction-currency",
+ "transaction-amount",
+ "language",
+ "bday",
+ "bday-day",
+ "bday-month",
+ "bday-year",
+ "sex",
+ "tel",
+ "tel-country-code",
+ "tel-national",
+ "tel-area-code",
+ "tel-local",
+ "tel-extension",
+ "impp",
+ "url",
+ "photo",
+];
+
+export const IOSAppConstants = Object.freeze({
+ platform: "ios",
+ prefs: IOS_DEFAULT_PREFERENCES,
+ validAutocompleteFields: VALID_AUTOCOMPLETE_FIELDS,
+});
+
+export default IOSAppConstants;