Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

HomeStorage

Summary

Each HomeStorage object is associated with a single dataset. This object is used to save and delete data. Consumers can retreive a HomeStorage object through the HomeProvider API.

Method Overview

Promise save(in array items)
Promise deleteAll()

Item attributes

Attributes that can be specified on the items passed into save. These attributes will result in different displays when using the Home.panels API.

Attribute Type Required Description
url string yes URL associated with this item
title string no Title for the item.
description string no Description for the item.
image_url string no URL to an image associated with the item. Images are displayed in 95dp squares (95px on mdpi devices, 190px on xhdpi devices). Currently local images do not work (see bug 1004517).
filter string no Used to filter items in a dataset.
background_url string no

URL to a background image for the item.

New in Firefox 41.

background_color string no

Background color for the item, specified in hexadecimal notation. For example: #FF9500.

New in Firefox 41.

Methods

save()

Stores an array of data items. Returns a promise that is fulfilled after the data is saved.

Promise save(
  in array items,
  in object options
)
Parameters
items
An array of items to save. For performance reasons, we will throw an exception if you try to store more than 100 items at once. Additionally, a home panel view will only display 100 items at once.
options
(Optional) JS object holding additional configuration properties.
Attribute Type Description
replace boolean Whether or not to replace existing items.

deleteAll()

Deletes all items associated with this dataset. Returns a promise that is fulfilled after the data is deleted.

Promise deleteAll(
)

Document Tags and Contributors

 Contributors to this page: wbamberg, leibovic
 Last updated by: wbamberg,