Closed Bug 768950 Opened 12 years ago Closed 12 years ago

Port |Bug 763171 - Display received tabs|

Categories

(SeaMonkey :: Sync UI, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
seamonkey2.13

People

(Reporter: InvisibleSmiley, Assigned: InvisibleSmiley)

Details

Attachments

(2 files, 1 obsolete file)

Attached patch patch (obsolete) — Splinter Review
Like Firefox, we should support the displayURI Sync command for receiving individual links to be opened in a tab.

NB: The issuing side is currently only supported by mobile Firefox. Will attach a test case (e.g. to be executed in Execute JS from xsidebar.mozdev.org) in a minute.
Attachment #637171 - Flags: review?(neil)
Attached file test case
The attached test case is based on test_clients_engine.js. It outputs to the Error Console for verification purposes only.
Comment on attachment 637171 [details] [diff] [review]
patch

This fires once per browser window, which would be bad any time when we didn't have exactly one browser window open. Sadly I can't find a good place to put some code to handle the case when we have no browser windows open. (The best I can find would be similar to the way the tasksOverlay code passes a dummy command line to nsBrowserContentHandler, but in this case you would have to use a command which then passes the desired URL to handURIToExistingBrowser.)
Attachment #637171 - Flags: review?(neil) → review-
There is a new patch on the original bug that fixes the multi-window issue.
Thanks Neil for catching the multi/non-window cases. The attached should take care of both issues.

Gavin raised the question on the base bug whether the new tab should be focused. After some thinking my answer is Yes: This command is currently only used for actively sending a tab from a mobile device to a computer, and I think that in that particular case the user's will and expectancy is that the tab is displayed on the computer and raised to the foreground.
Attachment #637171 - Attachment is obsolete: true
Attachment #638006 - Flags: review?(neil)
(In reply to Jens Hatlak (:InvisibleSmiley) from comment #4)
> Gavin raised the question on the base bug whether the new tab should be
> focused. After some thinking my answer is Yes: This command is currently
> only used for actively sending a tab from a mobile device to a computer, and
> I think that in that particular case the user's will and expectancy is that
> the tab is displayed on the computer and raised to the foreground.

UX explicitly requested that the tab be opened in the background. You may also wish to carry forward the comment in my patch that states why.
Comment on attachment 638006 [details] [diff] [review]
patch v2 [Checkin: Comment 9]

>+      if (mostRecentBrowserWindow) {
>+        mostRecentBrowserWindow.getBrowser().addTab(url, { focusNewTab: true });
[I wonder whether we should raise the window too, i.e. mostRecentBrowserWindow.content.focus();]

>+        Services.ww.openWindow(null, "chrome://navigator/content/navigator.xul", "_blank",
Should check the browser.chromeURL pref; all of our other callers do.
(Followup bug if you prefer.)
Attachment #638006 - Flags: review?(neil) → review+
Comment on attachment 638006 [details] [diff] [review]
patch v2 [Checkin: Comment 9]

Review of attachment 638006 [details] [diff] [review]:
-----------------------------------------------------------------

Per UX, the tab is supposed to open in the background. This does not violate the principle of least surprise. Having the browser do unexpected things automatically is not good.

That being said, this whole feature is currently a minor exception because Fennec allows sending tabs to clients that don't support displaying tabs because of a limitation in Sync. UX has stated that having the browser do something somewhat unexpected in this case is a lesser evil than having the tab disappear into the ether.

We (Sync) are working on a better long-term solution. See also bug 769744.

See https://hg.mozilla.org/services/services-central/rev/9d0bf5dddfc4 for UX-approved implementation, consistent with Firefox.
Attachment #638006 - Flags: feedback-
(In reply to Gregory Szorc from comment #7)
> Per UX, the tab is supposed to open in the background.
It is legitimate for SeaMonkey to have a different UX to Firefox. For instance we could follow up by adding a preference to choose whether to focus or not.

> Having the browser do unexpected things automatically is not good.
Well, that depends on how you define "automatic".
Comment on attachment 638006 [details] [diff] [review]
patch v2 [Checkin: Comment 9]

http://hg.mozilla.org/comm-central/rev/4e1ef6937c5c
(with comment 6 addressed)
Attachment #638006 - Attachment description: patch v2 → patch v2 [Checkin: Comment 9]
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.13
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: