Skip to content

Preventing Safari Autofill in Message Input Elements#1604

Draft
samhatter wants to merge 3 commits intoslskd:masterfrom
samhatter:preventing-safari-autofill
Draft

Preventing Safari Autofill in Message Input Elements#1604
samhatter wants to merge 3 commits intoslskd:masterfrom
samhatter:preventing-safari-autofill

Conversation

@samhatter
Copy link
Copy Markdown
Contributor

I've noticed that sometimes safari will try and autocomplete information within room message input element. I've experienced safari attempt to autofill email, password, even credit card information. This is dangerous because it could lead to user's browsers inadvertently doxxing them. I've read some information online indicating that safari ignores the id attributes on input elements but gives some attention to the name attribute to I'm going to try that.

@samhatter samhatter changed the title Adding name attribute to message input elements in an attempt to prevent safari from autofilling Adding name attribute to message input elements to prevent safari from autofilling Jan 15, 2026
@samhatter samhatter changed the title Adding name attribute to message input elements to prevent safari from autofilling Preventing Safari Autofill in Message Input Elements Jan 15, 2026
@samhatter
Copy link
Copy Markdown
Contributor Author

It seems to work ok but I'll test it out a bit more to see if Safari has truly decided to get outta my business and then submit pr

@jpdillingham
Copy link
Copy Markdown
Member

What do you think about using autocomplete=off? docs: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete

@samhatter
Copy link
Copy Markdown
Contributor Author

That's what one would expect right!? Turns out we already on have it on the element- safari is just incredibly persistent and actually this setup doesn't work 100%

@samhatter samhatter force-pushed the preventing-safari-autofill branch from e44b90d to 6b0c167 Compare March 21, 2026 04:02
@samhatter
Copy link
Copy Markdown
Contributor Author

I changed to a different strat of making the id less ambiguous, no name, and adding a placeholder. Hope this helps, will confirm in a while if I stop noticing this behavior since it is rather non-deterministic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants