New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 805026 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug
Team-Security-UX
Proj-XR
Proj-XR-VR



Sign in to add a comment

VR omnibox: Fine-tune scheme types that receive fade-elide treatment

Project Member Reported by cjgrant@chromium.org, Jan 23 2018

Issue description

Fade-based elision has now replaced ellipsis-based elision on the VR URL bar.  The algorithm is simple:

1. Horizontally shift the URL to ensure the rightmost edge of the rendered TLD (and a bit of path) are visible.
2. Fade either edge if they overflow the field.

The horizontal shift is selectively applied based on URL.  Currently, we shift if the URL is standard, not 'file' scheme, and has a non-empty host portion.

Can I get an Enamel sanity-check of this criteria?

Are there tweaks we should make?  For example, msw@ asked about 'filesystem' scheme during review.

---

For reference, the new approach is much less code.  Its tests are here:

https://cs.chromium.org/chromium/src/chrome/browser/vr/elements/omnibox_formatting_unittest.cc?dr=CSs&sq=package:chromium&l=120




 
Cc: -lgar...@chromium.org

Comment 2 by est...@chromium.org, Feb 12 2018

Cc: elawrence@chromium.org
I think that sounds okay to me, and similar to what we do on Android. elawrence, could you double-check too if that elision algorithm sounds good?
Cc: -elawrence@chromium.org
Owner: elawrence@chromium.org
Status: Assigned (was: Available)
Assigning to elawrence@ to obtain that answer.  Please bounce this back to me (or close it), depending on the response.  Thanks!
Cc: elawrence@chromium.org
Owner: cjgrant@chromium.org
Filesystem URIs have HTTP(S) URIs embedded within and as such should also be displayed with as much of the "tail" of the hostname visible as possible.

e.g. for 
  filesystem:http://webdbg.com/temporary/

if we have room for only 12 characters, I'd expect to see:

 webdbg.com/t

Similarly, I'm not sure I understand why we'd want to show file URIs from the left. I don't think they are very interesting from a spoofing point-of-view (due to the fact that web content shouldn't be able to navigate to file://) but it seems like optimizing to show the tail of any hostname would also be reasonable here?
Interesting input, Eric!

On filesystems: That's interesting, and I'll look into it.

On files:  Given that there's just a scheme and path, it'd be useful to show both, but we can't.  If we right-align files, and the filename is really long, we'd get "eally_long_filename.txt" or similar.  I'll go ahead with that change unless you disagree.

Thanks for thinking about this!


Labels: -M-66 M-67
Labels: Hotlist-VRB-MVP
Components: -UI>Security>UrlFormatting UI>Browser>VR
Components: UI>Security>UrlFormatting
Hmm, no, but I applied that component only so it'd be properly triaged and obtain the feedback you gave.  Restoring the component.

Comment 10 by ericde@google.com, Mar 6 2018

@cjgrant : is this MVP given it's P2? 
On filesystem scheme handling:

I briefly looked into this, and found it'll be tricky to do.  GURL and url::Parsed have the notion of an inner URL (eg. the 'http' host inside the outer filesystem scheme), but FormatUrl() doesn't seem to.  When we format a filesystem URL, it builds a new Parsed representation of the URL, but doesn't supply any insight into the inner URL.

To make this work, we'd need to augment components/url_formatter to understand inner URLs, and apply formatting to them as well.  See:

https://cs.chromium.org/chromium/src/components/url_formatter/url_formatter.cc?q=url_formatter::FormatUrl&sq=package:chromium&dr=Ss&l=460

@elawrence, in the VR browser use-case, do you consider the filesystem case to be a spoofing risk?  I don't understand this case well enough to judge this.
On file:///:

Thinking more about this, I wonder if there's more value in showing the user that they're looking at a file, than there is in viewing the tail end of the filename.  As it's not a spoofing risk, I haven't touched this change yet.
Cc: mea...@chromium.org
RE #11: I believe the risk of spoofing via filesystem:// is pretty low; the feature is pretty obscure and I believe meacer@ is looking to deprecate top-level navigations to such URLs.

RE #5/#12: One point to note is that a file:// URI may contain a hostname, if the target file is located on a different system, e.g. file://machinename/folder/file.txt 

Thanks for the quick responses on FileSystem!  Case closed on that front.

On file scheme:

We should simply remove our special-case for file.  Then, if there's a hostname, we'll present it the same way we would for http/https - show the rightmost portion.  If there's no host (ie. the file:///path case), then we'll just show it like a data URL:

"file:///really/long/path/..."

To Eric's original point, if there's a strong desire to show the end of the path (ie. filename) over the scheme, then we have a different special case - that is, in the "file with no hostname" case, right-align the whole thing.  I think we've agreed this isn't a security/spoofing thing, but a "what makes sense" thing.




Project Member

Comment 16 by bugdroid1@chromium.org, Apr 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1cecec489fc7a1e8216e2c8b90bc270b9e504d2c

commit 1cecec489fc7a1e8216e2c8b90bc270b9e504d2c
Author: Christopher Grant <cjgrant@chromium.org>
Date: Tue Apr 03 21:05:30 2018

VR: Treat file URLs like https in origin presentation

If a file URL has a hostname, treat it like an http/https hostname.  In
other words, don't special-case the file scheme, and ensure we show the
rightmost portion of the hostname if present.

BUG= 805026 

Change-Id: I609198db5523d0ec9085e4a4942e7276ee2c273e
Reviewed-on: https://chromium-review.googlesource.com/993496
Reviewed-by: Eric Lawrence <elawrence@chromium.org>
Commit-Queue: Christopher Grant <cjgrant@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547826}
[modify] https://crrev.com/1cecec489fc7a1e8216e2c8b90bc270b9e504d2c/chrome/browser/vr/elements/omnibox_formatting.cc
[modify] https://crrev.com/1cecec489fc7a1e8216e2c8b90bc270b9e504d2c/chrome/browser/vr/elements/omnibox_formatting_unittest.cc
[modify] https://crrev.com/1cecec489fc7a1e8216e2c8b90bc270b9e504d2c/chrome/browser/vr/testapp/vr_test_context.cc

Status: Fixed (was: Assigned)
Labels: Test-Complete
Status: Verified (was: Fixed)
Fix verified in build 67.0.3396.29 beta.  Looks good.

Sign in to add a comment