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) |
|
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: 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( )