mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-11 21:34:43 -04:00
Don't fail if browser blocks window opening
This commit is contained in:
parent
2296881d2f
commit
b21015c377
@ -5406,8 +5406,11 @@ function addListenersToLink(a, href, baseUrl) {
|
|||||||
articleContainer = window.open('article.html', params.windowOpener === 'tab' ? '_blank' : a.title,
|
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);
|
params.windowOpener === 'window' ? 'toolbar=0,location=0,menubar=0,width=800,height=600,resizable=1,scrollbars=1' : null);
|
||||||
appstate.target = 'window';
|
appstate.target = 'window';
|
||||||
articleContainer.kiwixType = appstate.target;
|
// We have to make this conditional, because sometimes this action is blocked by the browser
|
||||||
articleWindow = articleContainer;
|
if (articleContainer) {
|
||||||
|
articleContainer.kiwixType = appstate.target;
|
||||||
|
articleWindow = articleContainer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user