1

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?

ealfonso
  • 6,622
  • 5
  • 39
  • 67

1 Answers1

1
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

Luckyrat
  • 1,455
  • 14
  • 16