-
-
Notifications
You must be signed in to change notification settings - Fork 532
enhance: Add an option to control browser-level autofill behavior on Windows #1649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Legend-Master
merged 4 commits into
tauri-apps:dev
from
aoxiangtianyu-go:feat/windows-autofill-control
Feb 23, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
34345aa
feat(windows): add option to control browser autofill behavior
aoxiangtianyu-go 2eadced
refactor(webview): use bool for general autofill setting
aoxiangtianyu-go b069e6c
docs: update with_general_autofill_enabled docs
aoxiangtianyu-go ebfc81f
docs: remove uncorrect description
aoxiangtianyu-go File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| 'wry': 'patch:enhance' | ||
| --- | ||
|
|
||
| Add an option to control browser-level autofill behavior on Windows. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oof i had a comment pending here for ages but didn't see that. Do you have some source or references for that issue? I don't think i heard about this before.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for checking! The behavior I mentioned is documented in the Wry issue #1535, which explains that WebView2’s “Suggestions” (autofill) may ignore
autocomplete="off"on input elements in some cases.In practice, i’ve observed this in clash-verge-rev/clash-verge-rev#5944 , where using
autocomplete="new-password"still triggered autofill.The Wry issue references the official WebView2 setting
CoreWebView2Settings.IsGeneralAutofillEnabledas a way to control this behavior globally.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't really reproduce that though
That sounds correct no? You asked the browser to trigger autocomplete with new-password
I think maybe we could remove this part from the docs, I don't mind adding this in the wry webview settings though
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to successfully reproduce this issue in the clash-verge-rev/clash-ver#5944. However, when I created a brand new Tauri project to build a minimal reproduction case, I failed to reproduce it, and the root cause remains unclear.
This is not the intended behavior. According to the MDN documentation for the
new-passwordattribute valuenew-password: "This may be used by the browser both to avoid accidentally filling in an existing password and to offer assistance in creating a secure password."Additionally, MDN security implementation guide explicitly states: "If you are defining a user management page where a user can specify a new password for another person, and therefore, you want to prevent autofilling of password fields, you can use autocomplete="new-password"."
These documents clearly indicate that the intended behavior of
new-passwordis to avoid unwanted autofill of existing passwords, rather than triggering autofill.I will fully follow the decision on whether to remove this part from the docs or add it to the wry webview settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was previously handling an issue with
autocomplete=off, where Chrome would ignore it if the input was namedpasswordor had the typepassword. But I'm unsure if this behavior exists in WebView2, as it's also Chromium-based.Though this is not directly related to the issue, just curious.
I'm not quite understanding what you want to achieve with
autocomplete="new-password"? I think giving itautocomplete="new-password"attribute is telling the browser to autofill with a new password from a password manager?If your goal is to turn off the autocomplete, and if it is the logic from WebView2 that it will ignore
autocomplete="off"in some specific fields, maybe settinggeneral_autofill_enabledtofalseis the solution instead of settingautocomplete="new-password"?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly. Currently, Tauri and Wry do not expose
ICoreWebView2Settings4::SetIsGeneralAutofillEnabled, so usingautocomplete="new-password"in the frontend is merely a temporary workaround we're forced to use.However, as we discussed, these frontend hacks are unreliable because WebView2/Chromium often overrides them. This is precisely why I initiated this PR: to provide a robust, native way to disable autofill at the WebView level during construction, rather than relying on inconsistent HTML attributes.