mirror of
https://github.com/status-im/status-go.git
synced 2025-01-09 14:16:21 +00:00
f3af6aa4dc
These APIs are being introduced to address #2706 and #2704, provided that clients will move to using these APIs instead of the currently provided equivalent APIs in the browser service. The `bookmarks` table is being extended with a `deleted_at` field which can later be used for garbage collection, as "removing" a bookmark is merely soft deletion and doesn't actually remove the data from the database. In addition to those APIs adding and soft deleting bookmark entries, they also automatically perform a sync operation to ensure that bookmarks are synced in real-time (#2704). Closes #2706, #2704
Browsers Service
Browser service provides read/write API for browser object.
To enable include browsers config part and add browsers
to APIModules:
{
"BrowsersConfig": {
"Enabled": true,
},
APIModules: "browsers"
}
API
Enabling service will expose three additional methods:
browsers_addBrowser
Stores browser in the database. All fields are specified below:
{
"browser-id": "1",
"name": "first",
"timestamp": 10,
"dapp?": true,
"history-index": 1,
"history": [
"one",
"two"
]
}
browsers_getBrowsers
Reads all browsers, returns in the format specified above. List is sorted by timestamp.
browsers_deleteBrowser
Delete browser from database. Accepts browser id
.