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

Issue 919773 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Jan 9
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Switch to this tab omnibox button works weirdly with PWAs

Project Member Reported by dominickn@chromium.org, Jan 8

Issue description

Not sure if this is a Mac only problem (haven't tested this on other systems). Marking as P2 (possibly P3) since it's a polish item.

Chrome Version: 73.0.3642.0
OS Version: OS X 10.14.2

What steps will reproduce the problem?

a. If you're not running Dev or Canary, enable chrome://flags/#enable-desktop-pwas
b. Ensure that when you have a Gmail tab open, opening a new tab and typing "gmail" in the omnibox gives you a Switch to this tab option.

1. Create a shortcut for Gmail (Open Gmail in a tab, 3-dot menu -> More Tools -> Create Shortcut). Ensure Open as Window is ticked
2. Close the Gmail tab
3. Open the Gmail window via the system shortcut or via chrome://apps. Gmail should be open in a window
4. Switch back to Chrome browser and type "gmail" in the omnibox


What is the expected result?

No "switch to this tab" option is seen. OR "switch to this tab" focuses the Gmail window.


What happens instead of that?

You'll see "Switch to this tab" in the omnibox. Selecting the "switch to this tab" option does nothing


UserAgentString: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3642.0 Safari/537.36



 
Cc: k...@chromium.org
Labels: OS-Chrome OS-Linux OS-Windows
My personal opinion is that the "switch to this tab" button should *not* be present if the only available matching tab is in a PWA window. It kind of breaks the native feel of those windows, and it would likely be complex to allow focusing a PWA window in response to the switch to tab.

The fix looks straightforward: ChromeAutocompleteProviderClient::IsTabOpenWithURL()[1] needs to ignore any browser where browser->is_app() returns true. Otherwise it will search through app windows and claim they can be switched to.

+cc kbr: WDYT?

[1] https://cs.chromium.org/chromium/src/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc?type=cs&sq=package:chromium&g=0&l=396
I guess I'm either having trouble duplicating this, or don't see the issue. When I type "mail" (what I have to type to get the suggestion), I get a suggestion for the Gmail URL and a tab switch button. When I click on it, it switches to that window. This is on 73.0.3642.0.

Just so I'm on the same page: The key issue here is that when you click the button, nothing happens, right? That's pretty weird since we use the same logic to find the tab before and after. The only way I've been able to duplicate that is to close the other window or tab /after/ generating suggestions. (There was a recent bug, but we now open a new copy in this case.)

When mine switched windows, it looked exactly as we intended. If you had a window buried where the target tab was, we'd want to surface it. (Otherwise you might open a duplicate one.) This is exactly what tab switching was supposed to solve. Also, I'm would think, especially for PWAs, that you'd want only one copy. So I don't currently agree that we should disable it.

I can keep trying but if you have any suggestions for how to duplicate, I believe that I can simply fix the original issue, rather than cripple it unnecessarily.
Cc: jdonnelly@chromium.org
Status: WontFix (was: Untriaged)
Strange, this does appear to be working properly now. I'm not sure why this wasn't working for me yesterday - I will keep an eye out to see if it starts happening again. Thanks!

Sign in to add a comment