在较新的firefox插件上使用Blob

Use Blob on newer firefox add-on

本文关键字:Blob 插件 firefox      更新时间:2023-09-26

这个答案已经过时了:

let { Cc, Ci, Cu, CC } = require('chrome');
const {Blob, File} = Cu.import("resource://gre/modules/Services.jsm", {});
console.log(typeof Blob);//undefined

如何导入blob?

Cu.importGlobalProperties(["Blob"]);

这适用于FF35以后。旧的方法应该可以在FF34或更低的版本上工作。

相关阅读:https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.importGlobalProperties