DuckChat

interface DuckChat

DuckChat interface provides a set of methods for interacting and controlling DuckChat.

Functions

Link copied to clipboard
abstract fun isDuckChatUrl(uri: Uri): Boolean

Determines whether a given Uri is a DuckChat URL.

Link copied to clipboard
abstract fun isEnabled(): Boolean

Checks whether DuckChat is enabled based on remote config flag. Uses a cached value - does not perform disk I/O.

Link copied to clipboard
abstract fun openDuckChat(query: String? = null)

Opens the DuckChat WebView with optional pre-filled String query.

Link copied to clipboard
abstract fun openDuckChatWithAutoPrompt(query: String)

Auto-prompts the DuckChat WebView with the provided String query.

Link copied to clipboard
abstract fun showInBrowserMenu(): Boolean

Checks whether DuckChat should be shown in browser menu based on user settings. Uses cached values - does not perform disk I/O.

Link copied to clipboard
abstract suspend fun wasOpenedBefore(): Boolean

Returns true if Duck Chat was ever opened before.