Hi @cfi.floralyz
For a single File update the script to this:
async function shared(){
var image = await fetch("ImageURL");
var blob = await image.blob();
var file = new File([blob], "ImageFileName", {type: blob.type})
var sharedata = {
title: "Title",
files:[file]
}
if(!navigator.share){
navigator.clipboard.writeText("URL");
alert("Copied to clipboard");
}
if(navigator.share){
try{
await navigator.share(sharedata)
console.log("Blog shared successfully")
}
catch(err) {
console.log("error")
}
}}
shared();
The rest remains same.