Closed Bug 1408361 Opened 9 years ago Closed 8 years ago

Received tab is truncated prematurely in notification

Categories

(Firefox :: Sync, defect, P2)

49 Branch
defect

Tracking

()

RESOLVED FIXED
Firefox 60
Tracking Status
firefox60 --- fixed

People

(Reporter: rfeeley, Assigned: tcsc)

Details

Attachments

(2 files)

STEPS TO REPRODUCE 1. Be signed in to Sync on multiple device 2. Send a Google search results page to another device (I sent from iOS to desktop) URL I sent: https://www.google.ca/search?q=die+hard&ie=UTF-8&oe=UTF-8&hl=en-ca&client=safari EXPECTED - Tab arrives and notification shows as much URL as possible, truncating with … Solution 1: https://www.google.ca/search?q=die+hard&ie=UT… Solution 2: https://www.google.ca/search?… ACTUAL RESULTS - URL in notification is http://www.google.ca/search
Attached image tab-received.png —
Although the full URL opens, the notification does not indicate that URL is fuller than shown.
We intentionally strip the query and fragment here: http://searchfox.org/mozilla-central/rev/ed1d5223adcdc07e9a2589ee20f4e5ee91b4df10/browser/components/nsBrowserGlue.js#2428-2433 I'm worried that including as much as we can after the `?` would make for noisy notifications, particularly for sites that like to add tracking parameters. We could definitely add an ellipsis after the query, as you suggest in solution 2.
Specifically, the discussion that decided we'd strip those is around here https://bugzilla.mozilla.org/show_bug.cgi?id=1305737#c29. It might be worth only stripping the 2nd query parameter and on (which would be a trivial change to the code), and would do the right thing for at least the google case. I think we're partially we're trimming for aesthetic reasons in cases like this. We have the capability of displaying much larger URLs. But we could consider only stripping any of them if it wouldn't fit in the 1k-ish limit.
Are you ok with solution 2, rfeeley?
Flags: needinfo?(rfeeley)
Yes, solution two is ideal. In fact this is fine: https://www.google.ca/search…
Flags: needinfo?(rfeeley)
Priority: -- → P2
Assignee: nobody → tchiovoloni
Comment on attachment 8942962 [details] Bug 1408361 - Add ellipsis when truncating received tab URI for display. https://reviewboard.mozilla.org/r/213232/#review218984 Whoops, this version actually implements solution 2, and not the "this is fine" from comment #5. ::: browser/locales/en-US/chrome/browser/accounts.properties:100 (Diff revision 2) > # See: http://developer.mozilla.org/en/docs/Localization_and_Plurals > # #1 is the number of tabs received > # This version is used when we don't know any device names. > unnamedTabsArrivingNotificationNoDevice.body = #1 tab has arrived;#1 tabs have arrived > + > +# LOCALIZATION NOTE (singleTabArrivingWithTruncatedURL.body): It's not clear to me whether or not this actually needs to use a localized string, but I figured it's better to be safe and use one.
Comment on attachment 8942962 [details] Bug 1408361 - Add ellipsis when truncating received tab URI for display. https://reviewboard.mozilla.org/r/213232/#review220328 Looks good, thanks!
Attachment #8942962 - Flags: review?(eoger) → review+
Comment on attachment 8942962 [details] Bug 1408361 - Add ellipsis when truncating received tab URI for display. https://reviewboard.mozilla.org/r/213232/#review220332 Sorry! Something didn't seem right to me. ::: browser/components/nsBrowserGlue.js:2583 (Diff revision 2) > if (win.gURLBar) { > body = win.gURLBar.trimValue(body); > } > + if (wasTruncated) { > + let tmpl = bundle.GetStringFromName("singleTabArrivingWithTruncatedURL.body"); > + body = tmpl.replace("%S", body); I think you want to use bundle.formatStringFromName() here
Attachment #8942962 - Flags: review+
Comment on attachment 8942962 [details] Bug 1408361 - Add ellipsis when truncating received tab URI for display. https://reviewboard.mozilla.org/r/213232/#review220370 Thank you :)
Attachment #8942962 - Flags: review?(eoger) → review+
Pushed by tchiovoloni@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ed390edef55a Add ellipsis when truncating received tab URI for display. r=eoger
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 60
Comment on attachment 8942962 [details] Bug 1408361 - Add ellipsis when truncating received tab URI for display. https://reviewboard.mozilla.org/r/213232/#review220752 ::: browser/locales/en-US/chrome/browser/accounts.properties:102 (Diff revision 3) > # This version is used when we don't know any device names. > unnamedTabsArrivingNotificationNoDevice.body = #1 tab has arrived;#1 tabs have arrived > + > +# LOCALIZATION NOTE (singleTabArrivingWithTruncatedURL.body): > +# Used when a tab from a remote device arrives but the URL must be truncated. > +# Should display the URL with an indication that it's benen truncated. There's a typo (benen), in case someone in this bug has to touch this file in the near future.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: