Commit graph

2423 commits

Author SHA1 Message Date
Geoff Lankow
90b7ae7741 Bug 1715724 - Override telemetry products check in test_PasswordRulesManager_generatePassword.js. r=dimi DONTBUILD
This test is failing on Thunderbird, which doesn't have the telemetry events in question.

Differential Revision: https://phabricator.services.mozilla.com/D117401
2021-06-12 18:45:35 +00:00
Dimi Lee
32e7bc465a Bug 1708455 - P10. Add signon.usernameOnlyForm.enabled preference r=sfoster,tgiles
Differential Revision: https://phabricator.services.mozilla.com/D116238
2021-06-11 11:56:05 +00:00
Dimi Lee
b3902dc5a9 Bug 1708455 - P9. Add telemetry probe to measure the performance of detecting username-only forms. r=sfoster,tgiles
This patch adds two telemetry to measure the performance impact after adding
multi-page login support.

Telemtry PWMGR_IS_USERNAME_ONLY_FORM gives us an idea among
all forms that contain a possible username input (type is email or text), the propotion
of those forms that are considered as a username-only form by our heuristic. We can
use this data as a hint of whether the username-only form heuristic works properly.

Telemetry PWMGR_NUM_FORM_HAS_POSSIBLE_USERNAME_EVENT_PER_DOC gives us an
idea how many forms contain a possible username input per page. If the data shows that there are a
lot of pages that contain multiple forms with a possible username input, which
triggers the new code path added in this bug, we might need to pay more attention to see whether the
change introduces performance overhead for page load.

Ex. A doc has 4 forms
<form><input type=email autocomplete=username/></form>  <!-- This is a form with a possible username input, and it is a username-only form-->
<form><input type=text autocomplete=username/></form>   <!-- This is a form with a possible username input, and it is a username-only form-->
<form><input type=email/></form>                        <!-- This is a form with a possible username input, but it is NOT a username-onlyc form -->
<form><input type=urk/></form>                          <!-- This is a form WITHOUT a possible username input -->

PWMGR_IS_USERNAME_ONLY_FORM records
bucket[0] = 1  // 1 form with a possible username input but not a username-only form
bucket[1] = 2  // 2 forms are username-only form.

PWMGR_NUM_FORM_HAS_POSSIBLE_USERNAME_EVENT_PER_DOC records
bucket[0] = 0
bucket[1] = 1  // 1 doc has 1 or more than 1 form with a possible-username input
bucket[2] = 1  // 1 doc has 2 or more than 2 form with a possible-username input
bucket[3] = 1  // 1 doc has 3 or more than 3 form with a possible-username input
bucket[4] = 0  // 0 doc has 4 or more than 4 form with a possible-username input

Depends on D113802

Differential Revision: https://phabricator.services.mozilla.com/D116237
2021-06-11 11:56:05 +00:00
Dimi Lee
4b3fa3554b Bug 1708455 - P8. Add AutoFillResult.FILLED_USERNAME_ONLY_FORM to record autofill in username-only forms. r=sfoster,tgiles
Depends on D113801

Differential Revision: https://phabricator.services.mozilla.com/D113802
2021-06-11 11:56:05 +00:00
Dimi Lee
c79fee63b8 Bug 1708455 - P7. Support login capture for multipage login forms. r=sfoster,tgiles
This patch saves the username field in a username-only form when the form is submitted.
When another form in the same document is submitted after that, if the form doesn't
have a username field, we then use the username field found in the username-only form to capture login.

This fits the case that in a multipage sign-in form, the first form is
usually a username-only form and the second form is usually a password-only form.

However, in the current approach, if in the second form, there is an input field before the
password field, we will use the input field in the second form as the username field, not the username field
in the first form. For example, in a multipage registration form, the first form is a username-only form to
enter your email, and the second form has an input field to enter the last name and a password field. With the
current approach, we will save "last name" + "password" instead of "username" + "password".

An alternate is always using the username field in the first form or coming up with a heuristic
to "compare" the two username fields. But since I haven't found a real-world example of the above scenario,
using the current approach seems a safer way to introduce the feature.

Depends on D113800

Differential Revision: https://phabricator.services.mozilla.com/D113801
2021-06-11 11:56:04 +00:00
Dimi Lee
604e31d5d3 Bug 1708455 - P6. Support autocomplete in a username-only form. r=sfoster,tgiles
In the previous patch to support autofill, a username field in a
username-only form is marked as a login manager field in '_fillForm'.
So this patch only makes autocomplete highlight work when autocomplete a username field.

This patch calls '_highlightFilledField' in 'onUsernameAutoCompleted'
when the autocompleted field is the username field in a username-only
form.
This is because when we autocomplete a username field in a form with password fields,
the highlight is done in '_fillForm'. However, in the case of a username-only
form, we don't have to call '_fillForm' anymore due to no password to fill.

Depends on D113799

Differential Revision: https://phabricator.services.mozilla.com/D113800
2021-06-11 11:56:04 +00:00
Dimi Lee
c03a1fd348 Bug 1708455 - P5. Support autofilling a username-only form. r=sfoster,tgiles
This patch does two things:
1. Checks whether a form is a username-only form after receiving 'DOMFormHasPossibleUsername' event.
   If it is, fetch logins from the parent to trigger form autofill.
2. Makes LoginManagerChild._fillForm compatible with an empty password field when there is an username field.

Depends on D113798

Differential Revision: https://phabricator.services.mozilla.com/D113799
2021-06-11 11:56:03 +00:00
Dimi Lee
a8a701a4a6 Bug 1708455 - P4. Add DOMFormHasPossibleUsernameField event to notify the password manager when a form has a text input or an email input. r=sfoster,tgiles,smaug
Right now, we limit the type of a username field in username-only forms to be either text or email.
This is different from what the password manager currently support in LoginHelper.isUsernameFieldType.
This is because text and email type are the most common cases for a username field, and we want to focus
on the cases that are more likely a username field.

This patch adds "DOMFormHasPossibleUsername" event to notify the password manager when a form has a possible
username field (text or email). The event works similar to the existing "DOMFormHasPassword" event.

Depends on D113797

Differential Revision: https://phabricator.services.mozilla.com/D113798
2021-06-11 11:56:03 +00:00
Dimi Lee
bb8bb066b1 Bug 1708455 - P3. Support showing password manager items in context menu for username fields that are in a username-only form. r=sfoster,tgiles
Before the patch, we don't show password manager items when there is no password fields found in a form.

In this patch, we do two things to support a username-only form in the context menu:
1. Add "other" category to fieldname hints. "other" is used for fields that are
   in a form but are neither "current-password", "new-password", nor "username".
   With the change, the "username" hint is now only used for fields that are considered a username field by the password manager.

2. When there is no password field in a form, ContextMenu also treat a
   form as a login form when the active field is a username field, which means it is a username-only form.

Depends on D113796

Differential Revision: https://phabricator.services.mozilla.com/D113797
2021-06-11 11:56:02 +00:00
Dimi Lee
8d762cf0e6 Bug 1708455 - P2. Support username-only forms in _getFormFields r=sfoster,tgiles
Before this patch, '_getFormFields' doesn't support forms without password fields.
In this patch, when a form doesn't have a password field, we use the
heuristic added in the previous patch to determine whether the form is a
username-only form. If it is, return the username field.

Depends on D113795

Differential Revision: https://phabricator.services.mozilla.com/D113796
2021-06-11 11:56:02 +00:00
Dimi Lee
28a04bb7a6 Bug 1708455 - P1. Add a heuristic to detect username-only login forms r=sfoster,tgiles
Differential Revision: https://phabricator.services.mozilla.com/D113795
2021-06-11 11:56:02 +00:00
Tim Giles
553a3daf55 Bug 1686071 - Add telemetry probe for number of passwords generated by custom rules versus default rules. r=dimi
This patch adds a histogram to keep track of the number of passwords generated via custom rules and default rules when "signon.improvedPasswordRules.enabled" is true.
This way, we can see if there is actual use of this feature for future decisions.

Differential Revision: https://phabricator.services.mozilla.com/D116870
2021-06-09 13:54:10 +00:00
Tim Giles
09a938a29b Bug 1686071 - Add and fix tests due to new password generation feature. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D114113
2021-06-09 13:54:10 +00:00
Tim Giles
4ca7c3542c Bug 1686071 - Generate passwords based on rules and domain. r=dimi
This patch will allow us to generate passwords based on rules and domains.

This patch also implements special characters needed to generated these new passwords.
However, this does not change the previous password generator behavior regarding special characters.
If a particular domain does not have a set of password rules associated with it, then we will generate a password with no special characters.

Differential Revision: https://phabricator.services.mozilla.com/D114111
2021-06-09 13:54:10 +00:00
Tim Giles
0180e3b96d Bug 1686071 - Add PasswordRulesParser module. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D114110
2021-06-09 13:54:09 +00:00
Tim Giles
72e5df1cbf Bug 1686071 - Add 'improved password rules' pref. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D114109
2021-06-09 13:54:09 +00:00
Dimi Lee
dd90fd4082 Bug 1714776 - Fix wrong string keywords in NewPasswordModel.jsm r=tgiles
Differential Revision: https://phabricator.services.mozilla.com/D117275
2021-06-09 13:53:03 +00:00
Ashray
2a6cced51a Bug 1707074 - wrap debug logging for related realms feature in a pref check. r=tgiles
Differential Revision: https://phabricator.services.mozilla.com/D116153
2021-06-04 17:04:19 +00:00
Andrew Halberstadt
f84d5f3016 Bug 1694824 - [ci] Annotate browser-chrome manifests for new fission failures, r=jmaher,extension-reviewers,preferences-reviewers,zombie
Differential Revision: https://phabricator.services.mozilla.com/D116276
2021-06-02 19:22:25 +00:00
Michelle Goossens
ef4e57256e Bug 1711515 - Remove gProtonDoorhangers, gProtonDoorhangersEnabled, and gProtonAppMenuEnabled from various jsms and other frontend (non-test) code r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D116246
2021-05-28 18:07:15 +00:00
julianwels
5d2bc1904a Bug 1662710 - Added UI to manage HTTPS-Only Mode exceptions from about:preferences. r=flod,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D102401
2021-05-27 20:07:32 +00:00
Dorel Luca
9707849e5b Backed out changeset ccdbd76fc479 (bug 1662710) for Browser-chrome failures in toolkit/components/passwordmgr/test/browser/browser_exceptions_dialog.js. CLOSED TREE 2021-05-27 19:03:46 +03:00
julianwels
e9e6d81961 Bug 1662710 - Added UI to manage HTTPS-Only Mode exceptions from about:preferences. r=flod,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D102401
2021-05-27 14:30:30 +00:00
Dimi Lee
e058a47bf6 Bug 1692980 - P2. Fix testcase failures after updating NewPasswordModel r=sfoster,tgiles
Differential Revision: https://phabricator.services.mozilla.com/D115872
2021-05-27 07:14:10 +00:00
Dimi Lee
fd60578ff7 Bug 1692980 - P1. Update NewPasswordModel.jsm to 55407b0. r=sfoster,tgiles
The improvements include:
* Add translated keywords

* Add a formHasMultipleVisibleInput signal.
This rule returns true when there is more than 3 visible input in a form.
Since the idea in the signal is that a registration page often has multiple inputs.
This rule only selects inputs whose type is either email, password, text, tel or empty,
which are more likely a input field for users to fill their information.

* Support formless password field in formHasMultipleVisibleInput signal.
For password fields don't have an associated form, signals that require a form always return false.
This patch adds an additional heuristic in formHasMultipleVisibleInput signal to support formless
password field. The heuristic works as follow:
  1. Locate the closest preceding input with selector
     "input[type=email],input[type=text],,input[type=tel],input[type=password]".
  2. Find the lowest common ancestor of the password field and the input field found in step1
  3. Use the common ancestor as the "form" element, apply `formHasMultipleVisibleInput` signal

* Add a firstFieldInFormWithThreePasswordFields signal
The signal is based on that change-password forms with 3 password fields
often have the "current password", "new password", and "confirm password" pattern.

Differential Revision: https://phabricator.services.mozilla.com/D111926
2021-05-27 07:14:10 +00:00
Michelle Goossens
6af282754f Bug 1711498 - Remove checks for protonAppMenuEnabled or protonToolbarEnabled smart pref getters from tests r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D115651
2021-05-21 15:51:13 +00:00
Kate Hudson
b6ba944291 Bug 1710859 - Add getVariable to FeatureAPI r=andreio
Differential Revision: https://phabricator.services.mozilla.com/D115264
2021-05-20 15:42:09 +00:00
Dorel Luca
839d70a6df Backed out changeset 4332f6c91f31 (bug 1710859) for Browser-chrome failures in toolkit/components/passwordmgr/test/browser/browser_autocomplete_import.js 2021-05-20 07:32:00 +03:00
Kate Hudson
bcc513d58c Bug 1710859 - Add getVariable to FeatureAPI r=andreio
Differential Revision: https://phabricator.services.mozilla.com/D115264
2021-05-20 02:55:26 +00:00
Michelle Goossens
4b9bb34823 Bug 1711480 - Remove proton doorhanger and modal pref changes from tests r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D115248
2021-05-17 23:04:49 +00:00
Gijs Kruitbosch
29f596f44a Bug 1708148 - switch to DOMContentLoaded in selectdialog.js for adding dialog content, to ensure it is present when we determine its height, r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D113724
2021-04-29 12:33:41 +00:00
Csoregi Natalia
a76b78d543 Backed out changeset e01ec8694924 (bug 1700957) as requested. CLOSED TREE 2021-04-28 18:09:01 +03:00
Emma Malysz
ce84c86379 Bug 1700957, graduate browser.proton.doorhangers.enabled pref to main proton pref r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D110135
2021-04-28 03:17:56 +00:00
Butkovits Atila
9597a30fbb Backed out changeset 1c362512f27b (bug 1700957) for causing failures at test_chrome_only_media_queries.html. CLOSED TREE 2021-04-28 05:55:14 +03:00
Emma Malysz
a344c0fa4c Bug 1700957, graduate browser.proton.doorhangers.enabled pref to main proton pref r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D110135
2021-04-28 00:29:45 +00:00
Ben Dean-Kawamura
d4413c9dd2 Bug 1651568: Removing legacy code to fetch syncId from the preferences. r=markh
- Moved ensureCurrentSyncID logic to the LoginManager component
- Added unit test for ensureCurrentSyncID()

Differential Revision: https://phabricator.services.mozilla.com/D113140
2021-04-27 23:56:51 +00:00
Olli Pettay
ce60441223 Bug 1592920 - Modify test_autofill_from_bfcache.html to work with Fission+bfcache, r=annyG
Differential Revision: https://phabricator.services.mozilla.com/D112813
2021-04-22 13:21:55 +00:00
Markus Stange
07b6d52ce8 Bug 1706454 - Use openMenu and activateItem in browser_context_menu_iframe.js and head.js. r=mac-reviewers,spohl
Differential Revision: https://phabricator.services.mozilla.com/D112818
2021-04-20 20:13:41 +00:00
Butkovits Atila
6dae709f27 Backed out changeset 6d1e9ad2dd1d (bug 1692980) for causing failures at test_isProbablyANewPasswordField.js. CLOSED TREE 2021-04-17 20:25:40 +03:00
Dimi Lee
901fa37b57 Bug 1692980 - Update NewPasswordModel.jsm to 78d4bf8. r=sfoster,tgiles
The improvements include:
* Add three french keywords
  - Add Créer to newStringRegex
  - Add S'inscrire to registerStringRegex
  - Add Créer un compte to registerStringRegex

* Add a formHasMultipleVisibleInput signal.
This rule returns true when there is more than 3 visible input in a form.
Since the idea in the signal is that a registration page often has multiple inputs.
This rule only selects inputs whose type is either email, password, text, tel or empty,
which are more likely a input field for users to fill their information.

* Support formless password field in formHasMultipleVisibleInput signal.
For password fields don't have an associated form, signals that require a form always return false.
This patch adds an additional heuristic in formHasMultipleVisibleInput signal to support formless
password field. The heuristic works as follow:
  1. Locate the closest preceding input with selector
     "input[type=email],input[type=text],,input[type=tel],input[type=password]".
  2. Find the lowest common ancestor of the password field and the input field found in step1
  3. Use the common ancestor as the "form" element, apply `formHasMultipleVisibleInput` signal

Differential Revision: https://phabricator.services.mozilla.com/D111926
2021-04-17 16:25:03 +00:00
Gijs Kruitbosch
71928caa84 Bug 1694418 - show origins in the title of the auth prompt, r=pbz,mtigley
Differential Revision: https://phabricator.services.mozilla.com/D108857
2021-04-16 21:28:46 +00:00
Sarah Ukoha
da4950549a Bug 1700412 - Refactor 'signon.recipes.remoteRecipesEnabled' pref to 'signon.recipes.remoteRecipes.enabled' r=tgiles
Differential Revision: https://phabricator.services.mozilla.com/D112064
2021-04-15 15:27:40 +00:00
Narcis Beleuzu
53edf49750 Backed out 2 changesets (bug 1704616) for Mochitest failures in remote/cdp/test/browser/page/browser_javascriptDialog_prompt.js. CLOSED TREE
Backed out changeset 16e0111f7c6d (bug 1704616)
Backed out changeset 623c1b4ecf35 (bug 1704616)
2021-04-14 21:54:42 +03:00
Gijs Kruitbosch
b7536c98da Bug 1704616 - work around promiseDocumentFlushed crashes in proton modal prompts, r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D111946
2021-04-14 14:58:44 +00:00
Dimi Lee
ea894d3ca8 Bug 1690865 - P3. Add tests to test isInferredUsernameField and isInferredEmailField r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D110471
2021-04-13 09:44:31 +00:00
Dimi Lee
dbb374a8d6 Bug 1690865 - P2. Add testcases for the username searching heuristic r=sfoster,tgiles
Differential Revision: https://phabricator.services.mozilla.com/D110470
2021-04-13 09:44:30 +00:00
Dimi Lee
5c18f0cd38 Bug 1690865 - P1. Implement a heuristic to locate the username field in a form. r=sfoster,tgiles
The username searching heuristic locates a username like or an email like field
by:
1. Checking if the input field's type is 'email'.
2. Checking if the input field's autocomplete attribute is 'username' or 'email'
3. Searching 'username' and 'email' keyword in:
   - The input field's "id", "name", "classname", and "placeholder" attributes.
   - The input field's associate label

If any of the above rule matches, we consider the field a username or an
email field depending on the keyword that matches.

When both a username-like and an email-like field are found in a form, select
the username-like field as the final username field. If no field is
found by the above heuristic, assume the first field before the first
password is the username (This is how it works before the patch).

Note. Right now, even with the new heuristic, we still only search fields
preecede the first password field like what we did before. This is because
from the sites I have tested (~250 sites), all the username fields
precede the first password field. If it turns out this is not true for
some sites, we can consider searching all the input fields in the form.

Differential Revision: https://phabricator.services.mozilla.com/D110469
2021-04-13 09:44:30 +00:00
Neil Deakin
94c3574da2 Bug 1703606, wait for the form to be submitted by using browserLoaded instead, fixes browser_doorhanger_generated_password.js and browser_private_window.js with bfcache in parent enabled, r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D111406
2021-04-12 23:06:41 +00:00
Paul Zuehlcke
6c972eed88 Bug 1698991 - Merge tab level proxy auth prompts with window prompts with matching auth-realm. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D110396
2021-04-12 12:18:24 +00:00
Andrei Oprea
ba84870a14 Bug 1699701 - Convert all usages of ExperimentFeature to singleton API r=k88hudson
Differential Revision: https://phabricator.services.mozilla.com/D110284
2021-04-09 14:13:13 +00:00