DownloadSummary

Provides an aggregated view on the contents of a DownloadList.

A reference to a DownloadSummary object can be obtained using the Downloads.getSummary() function.

Method overview

Promise bindToList(DownloadList aList);
Promise addView(Object aView);
Promise removeView(Object aView);

Properties

Attribute Type Description
allHaveStopped Read only boolean Indicates whether all the downloads are currently stopped.
progressTotalBytes Read only number

Indicates the total number of bytes to be transferred before completing all the downloads that are currently in progress.

For downloads that do not have a known final size, the number of bytes currently transferred is reported as part of this property.

This is zero if no downloads are currently in progress.

progressCurrentBytes Read only number

Number of bytes currently transferred as part of all the downloads that are currently in progress.

This is zero if no downloads are currently in progress.

Methods

bindToList()

This method may be called once to bind this object to a DownloadList.

Views on the summarized data can be registered before this object is bound to an actual list. This allows the summary to be used without requiring the initialization of the DownloadList first.

Note: This method is already called internally by theĀ Downloads.getSummary() function.
Promise bindToList(
  DownloadList aList
);
Parameters
aList
Underlying DownloadList whose contents should be summarized.
Promise resolves to

undefined when the view on the underlying list has been registered.

addView()

Adds a view that will be notified of changes to the summary. The newly added view will receive an initial onSummaryChanged notification.

Promise addView(
  Object aView
);
Parameters
aView
The view object to add. The following methods may be defined:
  • onSummaryChanged: Optional Called after any property of the summary has changed.
Promise resolves to

undefined when the view has been registered and the onSummaryChanged notification has been sent.

removeView()

Removes a view that was previously added using addView().

Promise removeView(
  Object aView
);
Parameters
aView
The view object to remove.
Promise resolves to

undefined when the view has been removed. At this point, the removed view will not receive any more notifications.

See also

Document Tags and Contributors

 Contributors to this page: P.A.
 Last updated by: P.A.,