In the download api we are working on for b2g, a download event in webidl
looks like:
[Constructor(DOMString type, optional DownloadEventInit eventInitDict)]
interface DownloadEvent : Event
{
readonly attribute DOMDownload? download;
};
dictionary DownloadEventInit : EventInit
{
DOMDownload? download = null;
};
DOMDownload is also defined in webidl, and has no xpidl equivalent, but
has a js/xpcom implementation.
I'm creating a download event with :
let event = new this._window.DownloadEvent("downloadstarted", {
download: createDOMDowloadObject(this._window, data)
});
where createDOMDownloadObject() returns a xpcom object implementing the
webidl interface. However this fails with this error:
[JavaScript Error: "'download' member of DownloadEventInit does not
implement interface DOMDownload." {file: "jar:file:///system/b2g/omni.ja!/
components/DownloadsAPI.js" line: 62}]
Is there a trick to get the js object to be seen as implementing
DOMDownload?
Fabrice
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform