new Places()
Places is the browser history, bookmark and icon management system for B2G.
Places is the browser history, bookmark and icon management system for B2G. Places monitors app events and syncs information with the Places datastore for consumption by apps like Search.
- Source:
Requires:
- module:BaseModule
Requires
- module:BaseModule
Members
_placeChanges :Object
A list of debounced changes to places, keyed by URL.
A list of debounced changes to places, keyed by URL.
Type:
- Object
- Source:
_timeouts :Object
Maps URLs to debounce save timeouts.
Maps URLs to debounce save timeouts. The place is saved after the timeout is reached, or on appload.
Type:
- Object
- Source:
dataStore :Object
A reference to the places datastore.
A reference to the places datastore.
Type:
- Object
- Source:
MAX_TOP_SITES :Integer
Maximum number of top sites we display
.Maximum number of top sites we display
Type:
- Integer
- Source:
screenshotQueue :Array
A queue of screenshot URLs that we are loading.
A queue of screenshot URLs that we are loading.
Type:
- Array
- Source:
STORE_NAME :String
The places store name.
The places store name.
Type:
- String
- Source:
writeInProgress :Boolean
Set when we are editing a place record in the datastore.
Set when we are editing a place record in the datastore.
Type:
- Boolean
- Source:
Methods
_start(callback)
Starts places.
Starts places. Adds necessary event listeners and gets the datastore.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
- Source:
clear()
Clear all the visits in the store.
Clear all the visits in the store.
- Source:
debounce(url)
Creates a timeout to save place data.
Creates a timeout to save place data.
Parameters:
Name | Type | Description |
---|---|---|
url |
String | URL of place. |
- Source:
debouncePlaceChanges(url, icon)
Saves place data to datastore after the apploaded event, or a timeout.
Saves place data to datastore after the apploaded event, or a timeout.
Parameters:
Name | Type | Description |
---|---|---|
url |
String | URL of place to update. |
icon |
String | The icon object |
- Source:
defaultPlace(url) → {Object}
Formats a URL as a place object.
Formats a URL as a place object.
Parameters:
Name | Type | Description |
---|---|---|
url |
String | The URL of a place. |
- Source:
Returns:
- Type
- Object
editPlace(url, fun)
Helper function to edit a place record in the datastore.
Helper function to edit a place record in the datastore.
Parameters:
Name | Type | Description |
---|---|---|
url |
String | The URL of a place. |
fun |
function | Handles place updates. |
- Source:
handleEvent(evt)
General event handler interface.
General event handler interface.
Parameters:
Name | Type | Description |
---|---|---|
evt |
Event | The event. |
- Source:
onIconChange(url, icon)
Set place icon.
Set place icon.
Parameters:
Name | Type | Description |
---|---|---|
url |
String | URL of place to update. |
icon |
String | The icon object |
- Source:
onLocationChange(url)
Add visit.
Add visit.
Updates our place cache. Currently this just increments frecency, but eventually there should be a separate 'visits' DataStore to store a record for every visit in order to render a history view.
Parameters:
Name | Type | Description |
---|---|---|
url |
String | URL of visit to record. |
- Source:
onTitleChange(url, title)
Set place title.
Set place title.
Parameters:
Name | Type | Description |
---|---|---|
url |
String | URL of place to update. |
title |
String | Title of place to set. |
- Source:
screenshotRequested(url)
Requests a screenshot of a URL.
Requests a screenshot of a URL.
Parameters:
Name | Type | Description |
---|---|---|
url |
String | The URL of a page. |
- Source: