mirror of
https://github.com/wukko/cobalt.git
synced 2025-05-06 08:44:31 +02:00
web/download: don't try to open non-https links
This commit is contained in:
parent
b125894b7e
commit
c4be1d3a37
@ -56,6 +56,10 @@ export const shareFile = async (file: File) => {
|
||||
}
|
||||
|
||||
export const openURL = (url: string) => {
|
||||
if (!['http:', 'https:'].includes(new URL(url).protocol)) {
|
||||
return alert('error: invalid url!');
|
||||
}
|
||||
|
||||
const open = window.open(url, "_blank");
|
||||
|
||||
/* if new tab got blocked by user agent, show a saving dialog */
|
||||
|
Loading…
x
Reference in New Issue
Block a user