Bug 1622749 - Force new documents resulting from clicking on notifications to open in tabs so we don't crash, r=nika

This is a temporary solution as we don't want to permanently override users'
preferences.

Differential Revision: https://phabricator.services.mozilla.com/D70761

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Anny Gakhokidze 2020-04-14 17:44:32 +00:00
parent 0b23988747
commit 20680c6e57

View File

@ -238,8 +238,9 @@ void OpenWindow(const ClientOpenWindowArgs& aArgs, BrowsingContext** aBC,
aRv.ThrowTypeError("Unable to open window");
return;
}
rv = bwin->OpenURI(uri, nullptr, nsIBrowserDOMWindow::OPEN_DEFAULTWINDOW,
// annyG: This is a hack to fix bug 1622749.
// We will force to open new windows in tabs so we don't crash later.
rv = bwin->OpenURI(uri, nullptr, nsIBrowserDOMWindow::OPEN_NEWTAB,
nsIBrowserDOMWindow::OPEN_NEW, principal, csp, aBC);
if (NS_WARN_IF(NS_FAILED(rv))) {
aRv.ThrowTypeError("Unable to open window");