Closed Bug 1396834 Opened 7 years ago Closed 7 years ago

[Regression] Don't show Clipboard bar for URLs that are already open in a tab

Categories

(Firefox for iOS :: General, enhancement)

Other
iOS
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Iteration:
1.30
Tracking Status
fxios 10.0 ---
fxios-v9.0 --- affected
fxios-v10.0 --- affected

People

(Reporter: SimonB, Assigned: jhugman, NeedInfo)

References

Details

(Whiteboard: [MobileCore][papercut])

Attachments

(1 file)

Build: 246293a0b
Device: iPhone 7
iOS: 10.3.3

Same issue as Bug 1359865 is still reproducible on latest master and beta 9.0(5725). 


Case 1:

Copy the page URL, background Firefox, and come back -- you get a toast offering to open the current page.

Case 2:

3D Touch the app icon and choose "Go to copied link".

Firefox opens, and offers to go to the copied link. Then the tab opens and the toast goes away.

Cases 3..N:

I expect this happens for links opened from Outlook or queued with View Later, too.

We should check whether we already have open, or are about to open, the copied link *before* we show the toast.
Flagging Robin for details on what our expected behavior should be here.
Flags: needinfo?(randersen)
Whiteboard: [MobileCore][NeedsStrings][papercut]
Assignee: nobody → jhugman
There are two things to do here: 

1) Detect if the URL is open in another tab.
2) If so, either offer to "Switch" to that tab, or not display the Clipboard bar at all.

Our current code is a little brittle: if the URL on the clipboard matches the one we offered to open last time, then don't offer to open it this time. 

We can put other URLs on the clipboard, then put the old one back, and it would offer to open it.

If the app is killed, the URL will be offered even if it's open.

Bug 1) should be fixed in this bug. Bug 2) is to change from not showing the bar to some other behaviour, perhaps "Switch".
(In reply to James Hugman [:jhugman] [@jhugman] from comment #2)

> 2) If so, either offer to "Switch" to that tab, or not display the Clipboard
> bar at all.

I suspect offering to switch isn't going to feel right: if I copy a URL, open it in Firefox, and then keep switching apps, Firefox will offer to switch each time I re-enter the app, no?

I'd do the simplest thing here: only offer to open a clipboard URL if (a) it isn't already open (this bug/Bug 1359865), and (b) we didn't already offer (already done?).


> We can put other URLs on the clipboard, then put the old one back, and it
> would offer to open it.

That's OK, though, no? If you re-copy a URL, with a pass through Firefox each time, and we don't have the tab open, it's not unreasonable to offer to open it.
> I'd do the simplest thing here: only offer to open a clipboard URL if (a) it isn't already open (this bug/Bug 1359865), and (b) we didn't already offer (already done?).
Bug 1359865 fixed your (b).

> I suspect offering to switch isn't going to feel right: if I copy a URL, open it in Firefox, and then keep switching apps, Firefox will offer to switch each time I re-enter the app, no?
The "Switch" option: yes, you're right, unless we have a similar "don't offer the same url twice in a row" rule as (b). But this becomes less and less useful given that we only offer the URL at the beginning of each session.

> I'd do the simplest thing here: only offer to open a clipboard URL if (a) it isn't already open (this bug/Bug 1359865), and (b) we didn't already offer (already done?).
Agreed.
Status: NEW → ASSIGNED
Iteration: --- → 1.30
Whiteboard: [MobileCore][NeedsStrings][papercut] → [MobileCore][papercut]
Attachment #8912195 - Flags: review?(gkeeley) → review+
Merged into master.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Whiteboard: [MobileCore][papercut] → [MobileCore][papercut][NeedsUplift]
UPlifted to v10.x
Whiteboard: [MobileCore][papercut][NeedsUplift] → [MobileCore][papercut]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: