Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
use the openerTabId as the source if it is set
Browse files Browse the repository at this point in the history
related 6971
auditors @bbondy @NejcZdovc
  • Loading branch information
bridiver committed Feb 1, 2017
1 parent d221604 commit 19fae59
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion atom/browser/api/atom_api_web_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2068,8 +2068,18 @@ void WebContents::OnTabCreated(const mate::Dictionary& options,
bool user_gesture = false;
options.Get("userGesture", &user_gesture);

int opener_tab_id = -1;
options.Get("openerTabId", &opener_tab_id);

content::WebContents* source = nullptr;
if (opener_tab_id != -1) {
source = extensions::TabHelper::GetTabById(opener_tab_id);
}
if (!source)
source = web_contents();

bool was_blocked = false;
AddNewContents(web_contents(),
AddNewContents(source,
tab,
active ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB,
gfx::Rect(),
Expand Down

2 comments on commit 19fae59

@bbondy
Copy link
Member

@bbondy bbondy commented on 19fae59 Feb 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this fully fix brave/browser-laptop#6971 ?
Seems so, but you just put "related to" and not "fix" in the commit message.

@bridiver
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might, I'm not 100% sure

Please sign in to comment.