Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opening origins that belong to specific containers via right click on certain engines opens an extra tab #421

Closed
kjozwiak opened this issue Apr 4, 2017 · 2 comments · Fixed by #436
Assignees
Labels
bug Something is broken!

Comments

@kjozwiak
Copy link

kjozwiak commented Apr 4, 2017

When opening an origin from google.com that's already assigned to a specific container in a different container using "Open Link in New Container Tab" via the right click context menu, another tab is opened in the second container which is blank and never closed.

Reproduced using: Google, Yahoo
Couldn't reproduce using: DDG, Bing

STR:

  • install the latest containers experiment (2.1.1 used in this case)
  • open a new personal container and visit reddit.com
  • right click on reddit and select "Always Open in This Container"
  • open a default contianer tab and visit google.com
  • search for reddit
  • on the main search result, right click on reddit -> Open Link in New Container Tab -> Work

You'll get a new tab that's opened in the Work container that's completely blank with the following URL which doesn't get removed:

https://www.google.ca/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwiYo6jar4vTAhXs6oMKHTt3CMcQFggaMAA&url=https%3A%2F%2Fwww.reddit.com%2F&usg=AFQjCNFTmzNOTpLfW33wey8AIySJgUmv_g&bvm=bv.151426398,d.amc

screen shot 2017-04-04 at 1 56 12 pm

screen shot 2017-04-04 at 1 56 25 pm

@kjozwiak kjozwiak added the bug Something is broken! label Apr 4, 2017
@kjozwiak kjozwiak added this to the Sprint 4 milestone Apr 4, 2017
@jonathanKingston jonathanKingston self-assigned this Apr 4, 2017
@jonathanKingston
Copy link
Contributor

jonathanKingston commented Apr 6, 2017

For my own sanity:

  1. User is in "container A" for web requestId: 2, tabId: 1
  2. User right clicks open in "container B" to mozilla.com
  3. User has already assigned website to "container C"
  4. Browser creates a new tabId: 2 for google.com/redirectmenow.... requestId: 3 in "Container B" timestamp: 1491484646519
  5. Browser then redirects to Mozilla.com creating requestId: 4 timestamp: 1491484646801
  6. Browser then creates a new tab with permission screen in tabId 3 in "container C"

@jonathanKingston
Copy link
Contributor

jonathanKingston commented Apr 6, 2017

I can solve the above case using webRequest as the first tab as an undefined originUrl however if the redirect comes from a ctrl+click link click to the same container the originUrl is Google and we can't know that it's not a normal link click that way.

Looking into combining this with webNavigation, not convinced it will work. I have a hunch what I needed was the unsupported: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/webNavigation/onCreatedNavigationTarget

It looks like I can't grab the history object for those tabs either as they don't have URLs.

The alternative is change the flow to what I was hoping to do post 53 release:

  1. User navigates to google.com
  2. Clicks link to Mozilla (Mozilla is assigned)
  3. Tab changes to warning screen (same container, if the user requested a new tab then it exists there instead)
  4. User clicks confirm
  5. New tab is created in the correct container (history object is checked for new tab on the confirm page)
  6. Previous tab is navigated backwards with history removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken!
Projects
None yet
2 participants