Closed Bug 1303362 Opened 8 years ago Closed 7 years ago

Handle links that open new tabs in Custom Tabs

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set
normal

Tracking

(firefox53 fixed)

RESOLVED FIXED
Firefox 53
Tracking Status
firefox53 --- fixed

People

(Reporter: droeh, Assigned: droeh)

References

Details

Attachments

(1 file, 1 obsolete file)

When a link clicked in a custom tab opens a new tab, we stay in the custom tabs activity. This is fairly opaque, as a user will not see any sign that the link has opened in a new tab, but navigation will be affected. 

Probably we want to open the link in Fennec in this case.
(In reply to Dylan Roeh (:droeh) from comment #0)
> Probably we want to open the link in Fennec in this case.

If I understand correctly, shouldn't a link that wants to be opened in a new tab, be forced into the same custom tabs activity so that it doesn't open as a background tab? Looking at Chrome's impl, this seems to be what they do as well, along with removing the menu options to open a link in a tab when Chrome is used as a custom tab.

An (unpreferred) alternative is to have a snackbar that notifies that a tab was opened in the background and the option to navigate to fennec to look at it.
My thought was not to open it as a background tab, but to actually switch to Fennec when such a link is clicked (by using an intent to open it in Fennec or something like that). But if Chrome just opens such links in the custom tab without creating a new tab, maybe that's a better way to go.
I'm going to WONTFIX this; I wrote up a mostly-working version of launching Fennec for links that want to be opened in a new tab, but it involves some ugly workarounds and basically seems worse, from a UX perspective, than just copying what Chrome does.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Oh, just yesterday I was thinking about this issue. Chrome just hides the option to do that (or implements a completely different context menu), right?
This is actually just about links that would normally open in a new tab (eg target="_blank"); the context menu for links is a whole other thing that I'm probably going to leave to front end people :)

Reopening this because yesterday I thought I could solve it as part of bug 1325174, but that turned out to be a bad idea.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
This sets a flag on custom tabs to prevent them from opening links in a new tab.
Attachment #8821185 - Flags: review?(snorp)
Comment on attachment 8821185 [details] [diff] [review]
Prevent links from opening in a new tab in custom tabs

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

::: mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
@@ +1587,5 @@
>                      }
>                      if (isFirstTab) {
>                          flags |= Tabs.LOADURL_FIRST_AFTER_ACTIVITY_UNHIDDEN;
>                      }
> +                    if (isCustomTab()) {

Don't do this, just add a getNewTabFlags() method that lets CustomTabsActivity return what it wants
Attachment #8821185 - Flags: review?(snorp) → review-
Fair enough, this patch handles the flags that way.
Attachment #8821185 - Attachment is obsolete: true
Attachment #8824248 - Flags: review?(snorp)
Attachment #8824248 - Flags: review?(snorp) → review+
Pushed by droeh@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/090e52000b34
Set a flag on custom tabs so that links do not open in a new tab. r=snorp
Pushed by droeh@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/657cf05df28d
Set a flag on custom tabs so that links do not open in a new tab. r=snorp
https://hg.mozilla.org/mozilla-central/rev/657cf05df28d
Status: REOPENED → RESOLVED
Closed: 7 years ago7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 53
Flags: needinfo?(droeh)
Blocks: 1346008
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: