share on fediverse: minimal checks on instance url

This commit is contained in:
Gabriele Musco 2021-06-28 11:08:31 +02:00
parent 8e03f9d453
commit cc8ade35b9
No known key found for this signature in database
GPG Key ID: 8539FD3454380B83
1 changed files with 6 additions and 1 deletions

View File

@ -28,11 +28,16 @@
return 'https://' + url;
}
function shareOnFedi() {
let instance = fixURL(fediInstanceInput.value);
let instance = fediInstanceInput.value.trim();
if (!instance) {
return;
}
instance = fixURL(instance);
window.open(
`${instance}/share?text=${articleTitle}%20${articleLink}`,
'__blank'
);
closeFediInstanceDialog();
}
</script>
{{ end }}