export async function saveFileFromUrl ( url , fileName ) { await browser . downloads . download ( { url , filename : fileName , saveAs : true } ) ; } export async function saveFileFromBuffer ( file , mimeType , fileName ) { const blob = new Blob ( [ file ] , { type : mimeType } ) ; const url = URL . createObjectURL ( blob ) ; await saveFileFromUrl ( url , fileName ) ; }