mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-29 11:06:10 +00:00
web/download: show saving dialog if new tab got blocked
This commit is contained in:
parent
299d1867a2
commit
cce3ce4cfa
|
@ -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