Please ignore previous comment. The issue disappears with the fix of Bug 1873215, but it doesn't fix the root problem. After receiving the state change event and performing [some checks](https://searchfox.org/mozilla-central/source/toolkit/components/formautofill/FormAutofillChild.sys.mjs#35-65) on it, we are falsely triggering a form submission (therefore the doorhanger is shown before the actual form submission). At that moment `aStateFlags` is `983041 `, which means it has the following flags: ``` { "STATE_START": 1, "STATE_IS_REQUEST": 65536, "STATE_IS_DOCUMENT": 131072, "STATE_IS_NETWORK": 262144, "STATE_IS_WINDOW": 524288, "STATE_IS_BROKEN": 1, "STATE_COOKIES_LOADED_TRACKER": 262144, "STATE_COOKIES_LOADED_SOCIALTRACKER": 524288, "STATE_BLOCKED_SOCIALTRACKING_CONTENT": 65536, "STATE_LOADED_SOCIALTRACKING_CONTENT": 131072, "LOCATION_CHANGE_SAME_DOCUMENT": 1 } ``` A fix could be to check for the Content Blocking Event flags before triggering the form submission. But that means we'll need to add state flags whenever new ones get added or cause a bug. So ideally we should check for specific flags that indicate a form submission instead of filtering out the ones that don't.
Bug 1873156 Comment 4 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Please ignore previous comment. The issue disappears with the fix of Bug 1873215, but it doesn't fix the root problem. After receiving the state change event and performing [some checks](https://searchfox.org/mozilla-central/source/toolkit/components/formautofill/FormAutofillChild.sys.mjs#35-65) on it, we are falsely triggering a form submission (therefore the doorhanger is shown before the actual form submission). At that moment `aStateFlags` is `983041 `, which means it has the following flags: ``` { "STATE_START": 1, "STATE_IS_REQUEST": 65536, "STATE_IS_DOCUMENT": 131072, "STATE_IS_NETWORK": 262144, "STATE_IS_WINDOW": 524288, "STATE_IS_BROKEN": 1, "STATE_COOKIES_LOADED_TRACKER": 262144, "STATE_COOKIES_LOADED_SOCIALTRACKER": 524288, "STATE_BLOCKED_SOCIALTRACKING_CONTENT": 65536, "STATE_LOADED_SOCIALTRACKING_CONTENT": 131072, "LOCATION_CHANGE_SAME_DOCUMENT": 1 } ``` A fix could be to check for the [Content Blocking Event flags](https://searchfox.org/mozilla-central/source/uriloader/base/nsIWebProgressListener.idl#255-394) before triggering the form submission. But that means we'll need to add state flags whenever new ones are added or cause a bug. So ideally we should check for specific flags that indicate a form submission instead of filtering out the ones that don't.
(comment removed)
*(comment removed)*