web/download: show saving dialog if new tab got blocked
This commit is contained in:
parent
299d1867a2
commit
cce3ce4cfa
1 changed files with 6 additions and 1 deletions
|
@ -13,7 +13,12 @@ export const openSavingDialog = (url: string) =>
|
||||||
})
|
})
|
||||||
|
|
||||||
export const openURL = (url: string) => {
|
export const openURL = (url: string) => {
|
||||||
return window.open(url, "_blank");
|
const open = window.open(url, "_blank");
|
||||||
|
|
||||||
|
/* if new tab got blocked by user agent, show a saving dialog */
|
||||||
|
if (!open) {
|
||||||
|
openSavingDialog(url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const shareURL = async (url: string) => {
|
export const shareURL = async (url: string) => {
|
||||||
|
|
Loading…
Reference in a new issue