【发布时间】:2019-01-15 01:28:07
【问题描述】:
我正在尝试将本地 csv 文件导入到我的 Firefox 扩展程序 background.js 脚本中。 到目前为止,我的脚本如下所示:
fetch('http://localhost:8080/folder1/myFile.csv').then(function(response) {
// Convert to JSON
return response.json();
}).then(function(j) {
// `j` is a JavaScript object
console.log(j);
});
fetch(request).then(function() { /* handle response */ });
而且我似乎无法得到任何 console.log-ed。我应该使用其他方法将我的 csv 作为对象吗?
另外,我用的是firefox开发者版
【问题讨论】:
标签: firefox xmlhttprequest firefox-addon fetch firefox-addon-webextensions