Paul
Paul

Reputation: 859

Use createObjectURL in Firefox javascript code module

I want to use web workers in a javascript code module that load code from a blob. Typically this could be done in a webpage by calling "window.URL.createObjectURL" on the blob and giving the url generated by createObjectURL to the worker. Is this possible in a javascript code module, despite there being no window.URL object?

Upvotes: 1

Views: 271

Answers (1)

paa
paa

Reputation: 5054

You can import the URL constructor

Components.utils.importGlobalProperties(['URL']);

Upvotes: 2

Related Questions