Closed Bug 1531135 Opened 6 years ago Closed 6 years ago

Add a pref to not autofill in password fields with an autocomplete field name of "off"

Categories

(Toolkit :: Password Manager, enhancement, P2)

enhancement

Tracking

()

VERIFIED FIXED
mozilla67
Tracking Status
firefox67 --- verified
firefox68 --- verified

People

(Reporter: MattN, Assigned: sfoster)

References

(Depends on 1 open bug)

Details

User Story

* Add a pref `signon.autofillForms.autocompleteOff` to disable autofill (without user interaction) when the autocomplete fieldName is "off" on <input type=password>.
** `passwordField.getAutocompleteInfo().fieldName == "off"`
* When the pref is false, filling from the autocomplete dropdown and context menu should still work (`userTriggered: true`)
* Continue to ignore @autocomplete=off on <form>, only consider it only on <input type=password>

Attachments

(1 file)

Similar to bug 1119063 but for autocomplete="off". We have constant backlash from webdevs since bug 1025703 as there are valid use cases where autocomplete="new-password" doesn't cover a case where the user wouldn't want login autofill. An example includes where you need to enter credentials for Site B in a form on Site A. This is common for setting up integrations between services.

Let's add a pref so we can experiment with honouring the autocomplete="off" in some cases.

Blocks: 1025703
No longer blocks: 956906
Depends on: 1352544
Assignee: nobody → sfoster
Pushed by sfoster@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1ba42a5ba5d6
Honor autocomplete=off on password when signon.autofillForms.autocompleteOff is false. r=MattN
Backout by rgurzau@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a902fdf8f03c
Backed out changeset 1ba42a5ba5d6 for failing at /test_basic_form_honor_autocomplete_off.html on a CLOSED TREE.

Backed out changeset 1ba42a5ba5d6 (bug 1531135) for failing at /test_basic_form_honor_autocomplete_off.html on a CLOSED TREE.

Backout link: https://hg.mozilla.org/integration/autoland/rev/a902fdf8f03ca2a1a502fd30077a7197bf79140e

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=pending%2Crunning%2Ctestfailed%2Cbusted%2Cexception&revision=1ba42a5ba5d672533f395b15dc1b87e44b19b743&selectedJob=232079671

Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=232079671&repo=autoland&lineNumber=4066

Log snippet:

05:56:01 INFO - TEST-START | toolkit/components/passwordmgr/test/mochitest/test_basic_form_honor_autocomplete_off.html
05:56:01 INFO - GECKO(10404) | ++DOMWINDOW == 10 (00000173EE83B800) [pid = 6188] [serial = 10] [outer = 00000173EE805F20]
05:56:01 INFO - GECKO(10404) | [Parent 1924, Main Thread] WARNING: 'aRv.Failed()', file z:/build/build/src/dom/ipc/StructuredCloneData.cpp, line 120
05:56:01 INFO - GECKO(10404) | TEST-PASS | https://example.com/tests/toolkit/components/passwordmgr/test/mochitest/parent_utils.js | Got autocomplete popup - [object XULPopupElement] == true
05:56:01 INFO - GECKO(10404) | [Parent 1924, Main Thread] WARNING: 'aRv.Failed()', file z:/build/build/src/dom/ipc/StructuredCloneData.cpp, line 120
05:56:01 INFO - GECKO(10404) | [Parent 1924, Main Thread] WARNING: 'aRv.Failed()', file z:/build/build/src/dom/ipc/StructuredCloneData.cpp, line 120
05:56:01 INFO - GECKO(10404) | [Parent 1924, Main Thread] WARNING: 'aRv.Failed()', file z:/build/build/src/dom/ipc/StructuredCloneData.cpp, line 120
05:56:01 INFO - GECKO(10404) | [Parent 1924, Main Thread] WARNING: 'aRv.Failed()', file z:/build/build/src/dom/ipc/StructuredCloneData.cpp, line 120
05:56:01 INFO - GECKO(10404) | [Parent 1924, Main Thread] WARNING: 'aRv.Failed()', file z:/build/build/src/dom/ipc/StructuredCloneData.cpp, line 120
05:56:01 INFO - GECKO(10404) | TEST-PASS | https://example.com/tests/toolkit/components/passwordmgr/test/mochitest/pwmgr_common_parent.js | Access LoginManager - true == true
05:56:01 INFO - GECKO(10404) | TEST-PASS | https://example.com/tests/toolkit/components/passwordmgr/test/mochitest/pwmgr_common_parent.js | Not expecting logins to be present - 0 == 0
05:56:01 INFO - GECKO(10404) | TEST-PASS | https://example.com/tests/toolkit/components/passwordmgr/test/mochitest/pwmgr_common_parent.js | Checking for successful init login - 1 == 1
05:56:01 INFO - GECKO(10404) | TEST-PASS | https://example.com/tests/toolkit/components/passwordmgr/test/mochitest/pwmgr_common_parent.js | Checking for no disabled hosts - 0 == 0
05:56:01 INFO - GECKO(10404) | TEST-PASS | setup | nsLoginInfo constructor - true == true
05:56:08 INFO - GECKO(10404) | --DOMWINDOW == 9 (00000173EE832400) [pid = 6188] [serial = 6] [outer = 0000000000000000] [url = about:blank]
05:56:08 INFO - GECKO(10404) | --DOMWINDOW == 8 (00000173EC46E400) [pid = 6188] [serial = 2] [outer = 0000000000000000] [url = about:blank]
05:56:10 INFO - GECKO(10404) | --DOMWINDOW == 11 (0000020A94B14800) [pid = 1924] [serial = 7] [outer = 0000000000000000] [url = about:blank]
05:56:10 INFO - GECKO(10404) | --DOMWINDOW == 10 (0000020A9567FC00) [pid = 1924] [serial = 11] [outer = 0000000000000000] [url = about:blank]
05:56:11 INFO - GECKO(10404) | --DOMWINDOW == 14 (000001A408AAB000) [pid = 10304] [serial = 2] [outer = 0000000000000000] [url = about:blank]
05:56:11 INFO - GECKO(10404) | --DOMWINDOW == 13 (000001A4094A2C00) [pid = 10304] [serial = 4] [outer = 0000000000000000] [url = about:blank]
05:56:11 INFO - GECKO(10404) | --DOMWINDOW == 12 (000001A4094A7C00) [pid = 10304] [serial = 10] [outer = 0000000000000000] [url = about:blank]
05:56:11 INFO - GECKO(10404) | --DOMWINDOW == 11 (000001A4094A4C00) [pid = 10304] [serial = 6] [outer = 0000000000000000] [url = about:blank]
05:56:11 INFO - GECKO(10404) | --DOMWINDOW == 10 (000001A4094A7000) [pid = 10304] [serial = 8] [outer = 0000000000000000] [url = about:blank]
05:56:12 INFO - GECKO(10404) | --DOMWINDOW == 2 (000001C08D67C400) [pid = 7640] [serial = 2] [outer = 0000000000000000] [url = about:blank]
05:56:13 INFO - GECKO(10404) | --DOCSHELL 000001C087D4B800 == 0 [pid = 7640] [id = {8314da5d-9653-407e-8727-b0a28eec1665}] [url = chrome://gfxsanity/content/sanitytest.html]
05:56:13 INFO - GECKO(10404) | --DOMWINDOW == 1 (000001C08D6EB020) [pid = 7640] [serial = 1] [outer = 0000000000000000] [url = chrome://gfxsanity/content/sanitytest.html]
05:56:13 INFO - GECKO(10404) | --DOMWINDOW == 7 (00000173EE8FAC00) [pid = 6188] [serial = 9] [outer = 0000000000000000] [url = https://example.com/tests/SimpleTest/iframe-between-tests.html]
05:56:13 INFO - GECKO(10404) | --DOMWINDOW == 6 (00000173E66B5000) [pid = 6188] [serial = 3] [outer = 0000000000000000] [url = about:blank]
05:56:13 INFO - GECKO(10404) | --DOMWINDOW == 5 (00000173EE83D000) [pid = 6188] [serial = 7] [outer = 0000000000000000] [url = about:blank]
05:56:13 INFO - GECKO(10404) | --DOMWINDOW == 4 (00000173EE551000) [pid = 6188] [serial = 8] [outer = 0000000000000000] [url = https://example.com/tests/toolkit/components/passwordmgr/test/mochitest/test_basic_form_honor_autocomplete_off.html]
05:56:14 INFO - GECKO(10404) | --DOCSHELL 000001A409481800 == 4 [pid = 10304] [id = {b5d54f9c-739d-46d3-a1aa-3e174d3c4227}] [url = moz-extension://e4f3ccf2-0ef4-4a3d-b18a-ef9b379d5659/_generated_background_page.html]
05:56:14 INFO - GECKO(10404) | --DOMWINDOW == 9 (000001A409422100) [pid = 10304] [serial = 9] [outer = 0000000000000000] [url = moz-extension://e4f3ccf2-0ef4-4a3d-b18a-ef9b379d5659/_generated_background_page.html]
05:56:15 INFO - GECKO(10404) | [Parent 1924, StreamTrans #116] WARNING: 'NS_FAILED(rv)', file z:/build/build/src/modules/libjar/nsJARChannel.cpp, line 371
05:56:15 INFO - GECKO(10404) | [Parent 1924, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80520012: file z:/build/build/src/modules/libjar/nsJARChannel.cpp, line 993
05:56:16 INFO - GECKO(10404) | --DOMWINDOW == 0 (000001C08F373000) [pid = 7640] [serial = 3] [outer = 0000000000000000] [url = chrome://gfxsanity/content/sanitytest.html]
05:56:16 INFO - GECKO(10404) | --DOMWINDOW == 8 (000001A40A762800) [pid = 10304] [serial = 15] [outer = 0000000000000000] [url = moz-extension://e4f3ccf2-0ef4-4a3d-b18a-ef9b379d5659/_generated_background_page.html]
05:57:58 INFO - GECKO(10404) | [Parent 1924, Lazy Idle] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80520012: file z:/build/build/src/widget/windows/WinUtils.cpp, line 1346
05:59:58 INFO - GECKO(10404) | [Parent 1924, Lazy Idle] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80520012: file z:/build/build/src/widget/windows/WinUtils.cpp, line 1346
06:01:01 INFO - TEST-INFO | started process screenshot
06:01:01 INFO - TEST-INFO | screenshot: exit 0
06:01:01 INFO - Buffered messages logged at 05:56:02
06:01:01 INFO - AddTask.js | Entering test setup
06:01:01 INFO - AddTask.js | Leaving test setup
06:01:01 INFO - AddTask.js | Entering test test_form1_honor_password_autocomplete_off
06:01:01 INFO - TEST-PASS | toolkit/components/passwordmgr/test/mochitest/test_basic_form_honor_autocomplete_off.html | found form under test
06:01:01 INFO - TEST-PASS | toolkit/components/passwordmgr/test/mochitest/test_basic_form_honor_autocomplete_off.html | Checking form1 username is:
06:01:01 INFO - TEST-PASS | toolkit/components/passwordmgr/test/mochitest/test_basic_form_honor_autocomplete_off.html | Checking form1 password is:
06:01:01 INFO - Buffered messages finished
06:01:01 INFO - TEST-UNEXPECTED-FAIL | toolkit/components/passwordmgr/test/mochitest/test_basic_form_honor_autocomplete_off.html | Test timed out.
06:01:01 INFO - SimpleTest.ok@https://example.com/tests/SimpleTest/SimpleTest.js:275:18
06:01:01 INFO - reportError@https://example.com/tests/SimpleTest/TestRunner.js:121:22
06:01:01 INFO - TestRunner._checkForHangs@https://example.com/tests/SimpleTest/TestRunner.js:142:7
06:01:01 INFO - setTimeout handlerTestRunner._checkForHangs@https://example.com/tests/SimpleTest/TestRunner.js:163:5
06:01:01 INFO - setTimeout handler
TestRunner._checkForHangs@https://example.com/tests/SimpleTest/TestRunner.js:163:5
06:01:01 INFO - setTimeout handlerTestRunner._checkForHangs@https://example.com/tests/SimpleTest/TestRunner.js:163:5
06:01:01 INFO - setTimeout handler
TestRunner._checkForHangs@https://example.com/tests/SimpleTest/TestRunner.js:163:5
06:01:01 INFO - setTimeout handlerTestRunner._checkForHangs@https://example.com/tests/SimpleTest/TestRunner.js:163:5
06:01:01 INFO - setTimeout handler
TestRunner._checkForHangs@https://example.com/tests/SimpleTest/TestRunner.js:163:5
06:01:01 INFO - setTimeout handlerTestRunner._checkForHangs@https://example.com/tests/SimpleTest/TestRunner.js:163:5
06:01:01 INFO - setTimeout handler
TestRunner._checkForHangs@https://example.com/tests/SimpleTest/TestRunner.js:163:5
06:01:01 INFO - setTimeout handlerTestRunner._checkForHangs@https://example.com/tests/SimpleTest/TestRunner.js:163:5
06:01:01 INFO - setTimeout handler
TestRunner._checkForHangs@https://example.com/tests/SimpleTest/TestRunner.js:163:5
06:01:01 INFO - TestRunner.resetTests@https://example.com/tests/SimpleTest/TestRunner.js:399:14
06:01:01 INFO - TestRunner.runNextTest@https://example.com/tests/SimpleTest/TestRunner.js:485:22
06:01:01 INFO - TestRunner.testUnloaded@https://example.com/tests/SimpleTest/TestRunner.js:681:20
06:01:01 INFO - @https://example.com/tests/SimpleTest/iframe-between-tests.html:11:10
06:01:01 INFO - EventListener.handleEvent*@https://example.com/tests/SimpleTest/iframe-between-tests.html:9:8
06:01:02 INFO - GECKO(10404) | MEMORY STAT | vsize 2102773MB | vsizeMaxContiguous 82870898MB | residentFast 92MB | heapAllocated 9MB
06:01:02 INFO - TEST-OK | toolkit/components/passwordmgr/test/mochitest/test_basic_form_honor_autocomplete_off.html | took 301141ms
06:01:02 INFO - GECKO(10404) | ++DOMWINDOW == 5 (00000173EE551000) [pid = 6188] [serial = 11] [outer = 00000173EE805F20]
06:01:02 INFO - TEST-START | Shutdown

Flags: needinfo?(sfoster)
Pushed by sfoster@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6261644bec17
Honor autocomplete=off on password when signon.autofillForms.autocompleteOff is false. r=MattN

I think if figured out the failures in test_basic_form_honor_autocomplete_off.html. Hopefully it rebases ok. When I later rebased locally I got some weird merging onto the patch from bug 1532805.

Flags: needinfo?(sfoster)
Blocks: 917325
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67

@Matt: Can you please specify how exactly you'd rather have this bug tested? I feel like I might be letting things slip if I was to rely on my current technical skill.

Flags: needinfo?(MattN+bmo)

I can confirm that when the "signon.autofillForms.autocompleteOff" is "false", the password fields with autocomplete=off will not get auto-filled and they will if the pref is set to "true".

I have only one dilemma: If the whole form has autocomplete=off, while the fields don't have this attribute, then both the username and the password fields will get autocompleted. Should th4e password field not get auto-filled in this situation?
Test page: https://bug1352544.bmoattachments.org/attachment.cgi?id=9050123

I have used the test pages from bug 1352544 to verify this implementation on Nightly v68.0a1 and Beta v67.0b4. Does this cover everything?

See Also: → 1539855
Depends on: 1539855
See Also: 1539855

(In reply to Bodea Daniel [:danibodea] from comment #10)

I have only one dilemma: If the whole form has autocomplete=off, while the fields don't have this attribute, then both the username and the password fields will get autocompleted. Should th4e password field not get auto-filled in this situation?
Test page: https://bug1352544.bmoattachments.org/attachment.cgi?id=9050123

See the user story:

  • Continue to ignore @autocomplete=off on <form>, only consider it only on <input type=password>

This pref only cares about that attribute on password fields.

I have used the test pages from bug 1352544 to verify this implementation on Nightly v68.0a1 and Beta v67.0b4. Does this cover everything?

I think that's good enough since we have no current plans to flip this pref.

Flags: needinfo?(MattN+bmo)

Got it. Thank you.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: