在我的chrome扩展程序中,我想从Blob网址中获取文件名。
我在background.js中的代码:
//listen when download occure
chrome.downloads.onCreated.addListener(foo);
function foo(e) {
//print all properties of e
for(var propName in e) {
propValue = e[propName]
console.log(propName,propValue);
}
}
例如,当我从whatsapp聊天下载一些文件时,输出如下:
bytesReceived 0
canResume false
danger safe
exists true
fileSize 798484
filename
finalUrl blob:https://web.whatsapp.com/8fbab0f3-f251-4dca-9d76-878d27dcc106
id 1932
incognito false
mime application/pdf
paused false
referrer
startTime 2019-11-18T07:42:12.973Z
state in_progress
totalBytes 798484
url blob:https://web.whatsapp.com/8fbab0f3-f251-4dca-9d76-878d27dcc106
但是文件名是:新文档2019-11-11 11.03.39_20191111110829.pdf
那我怎么得到文件名?