browser_api

TilesAPI

Browser APIs pertaining to the browser’s New Tab Page tiles.

Kind: global class


tilesAPI.addObserver(observer)

Add an observer to be notified when the browser’s New Tab Page tiles have changed. If available, the provided callback is triggered immediately with browser’s current New Tab Page tiles.

Kind: instance method of TilesAPI

Param Type Description
observer TilesChangedCallback Callback triggered when the browser’s New Tab Page tiles have changed.

tilesAPI.addTile(url, title)

Add a custom New Tab Page tile to the user’s profile. If successful, all registered observers will be notified.

Kind: instance method of TilesAPI

Param Type Description
url string URL of the custom tile to add.
title string Name that should be displayed with the tile.

tilesAPI.removeTile(url)

Remove a custom New Tab Page tile from the user’s profile. If successful, all registered observers will be notified.

Kind: instance method of TilesAPI

Param Type Description
url string URL of the custom tile to remove.

tilesAPI.editTile(oldUrl, newUrl, newTitle)

Edit a custom New Tab Page tile in the user’s profile. If successful, all registered observers will be notified.

Kind: instance method of TilesAPI

Param Type Description
oldUrl string URL of the custom tile to edit.
newUrl string New URL of the custom tile.
newTitle string New title of the custom tile.

TilesAPI.Tile : object

A single New Tab page tile.

Kind: static typedef of TilesAPI
Properties

Name Type Description
url string URL of the target site.
title string Name that should be displayed with the tile.
favicon_url string URL of the favicon for the target site.

TilesAPI.TilesChangedCallback : function

Callback triggered when browser’s New Tab Page tiles have changed.

Kind: static typedef of TilesAPI

Param Type Description
tiles Array.<Tile> The browser’s new New Tab Page tiles.