-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: Truncate URL appropriately on iOS #17924
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
base: main
Are you sure you want to change the base?
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
|
numberOfLines={1} | ||
ellipsizeMode="head" | ||
> | ||
{inputValueRef.current || activeUrl} |
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.
Instead of providing this with a child prop, is it possible to just set text
property on the native prop of the text ref?
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.
@Cal-L I'm kinda unsure of what you're asking here. I added the activeUrl
in as a fallback when the component first mounts but before the BrowserTab has done a setNativeProps
call. I'm on the fence of whether we really need it or not since it begs the question of whether the user is really on a web page if it hasn't even been loaded yet. I could add it to this area but the if (props.text)
will mean the changing of the inputValueRef.current
won't even occur since it is guarded by the conditional:
if (props.text) {
inputValueRef.current = props.text;
}
```
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.
@Cal-L Can we resolve the conversation?
|
|
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.
LGTM
Description
The purpose if this task is to fix a vulnerability whereby long URLs do not have the most important part of their URL (domain + TLD) visible in the WebView Browser URL Bar on iOS. We fix this by getting the URL bar to prioritize that portion of the URL while ellipsizing (
...
) the first part of the URL (protocol and subdomain, etc)Changelog
CHANGELOG entry: Move ellipsizing of WebView URL to beginning of URLs for security reasons
Related issues
Fixes: https://github.com/MetaMask/mobile-planning/issues/2310
Mobile-planning: https://github.com/MetaMask/mobile-planning/issues/2277
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist