Don't fail if browser blocks window opening

This commit is contained in:
Jaifroid 2023-06-01 15:01:40 +01:00
parent 2296881d2f
commit b21015c377

View File

@ -5406,8 +5406,11 @@ function addListenersToLink(a, href, baseUrl) {
articleContainer = window.open('article.html', params.windowOpener === 'tab' ? '_blank' : a.title,
params.windowOpener === 'window' ? 'toolbar=0,location=0,menubar=0,width=800,height=600,resizable=1,scrollbars=1' : null);
appstate.target = 'window';
articleContainer.kiwixType = appstate.target;
articleWindow = articleContainer;
// We have to make this conditional, because sometimes this action is blocked by the browser
if (articleContainer) {
articleContainer.kiwixType = appstate.target;
articleWindow = articleContainer;
}
}
}
e.preventDefault();