WebviewerDBStore
Unofficial
Stores and manages all history items and cached fav icons.
Import:
import type { WebviewerDBStore } from '@obsidian-typings/obsidian-public-latest';Signature:
export interface WebviewerDBStoreProperties
| Property | Type | Description | |
|---|---|---|---|
| app | App | Reference to the obsidian#App. | |
| db | IDBDatabase | Underlying database used to store history items and fav icons via IndexedDB. |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| addHistoryItem(url, title?) | Promise<void> | Add a history item to the database. | |
| clearHistoryItems() | Promise<void> | Clear all history items. | |
| connect() | Promise<void> | Open and initialize the IndexedDB connection. | |
| getHistoryItems() | Promise<WebviewerHistoryItem[]> | Get all history items. | |
| loadIcon(domain, source?) | Promise<null | string> | Load stored icon in Base64 encoded string. If no stored icon available in the database, it also stores the icon. | |
| removeHistoryItem(item) | Promise<void> | Remove specific history item based on its id. | |
| setIcon(el, url, source?) | Promise<void> | Add a fav icon to the element. | |
| storeIcon(domain, source?) | Promise<null | string> | Store specific icon for the given domain name in Base64 string. |
Links to this page: