ealfonso
ealfonso

Reputation: 7302

Use Blob on newer firefox add-on

This answer is outdated:

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

How do I import a blob?

Upvotes: 1

Views: 189

Answers (1)

Luckyrat
Luckyrat

Reputation: 1455

Cu.importGlobalProperties(["Blob"]);

This works from FF35 onwards. The older approach should work on FF34 and lower.

Related reading at: https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.importGlobalProperties

Upvotes: 1

Related Questions