DuckChat
DuckChat interface provides a set of methods for interacting and controlling DuckChat.
Properties
Functions
Requests that the active voice session on the tab with the given tabId end. This drives the web frontend to tear down the session (stop recording, release the mic) and report it ended, which in turn releases the native voice resources.
Returns the Duck.ai URL that opens with the settings panel open (e.g. https://duck.ai?settings=open), using the configured Duck.ai host. Used to reach Duck.ai settings from outside the Duck.ai web view.
Returns the Duck Chat URL to be used
Returns true when the user enabled Duck.ai chat history in settings.
Returns true when the native Duck.ai chat history surface is enabled by all gating feature flags. Suspending because the underlying feature-flag reads must not block the main thread.
Determines whether a given Uri is a DuckChat URL. There are two Duck Chat URLs Legacy: https://duckduckgo.com/?q=DuckDuckGo+AI+Chat&ia=chat&duckai=5 After Migration: https://duck.ai/chat?q=DuckDuckGo+AI+Chat&duckai=5&atb=v520-1ru&ko=-1&t=ddg_android&migration=native-import https://app.asana.com/1/137249556945/task/1210497696306780
Returns true if the user has ever interacted with the Duck.ai input screen toggle — enabled it explicitly, or had a value written implicitly (e.g. the onboarding selection). Sticky once set.
Returns true if a voice session is currently active on the tab with the given tabId.
Observes the value for the automatic context attachment for Contextual Mode
Observes whether the user has enabled chat suggestions.
Observes the cosmetic value for the input screen user setting. Returns null if the cosmetic value has not been set before.
Emits whether the most recent Chat Tab suggestions fetch returned any entries, reflecting the currently displayed suggestions for the latest query.
Observes whether Duck.ai input screen with a mode switch is enabled or disabled.
Observes whether the Duck.ai native chat input integration is enabled. Emits true only when both the native input widget and the nativeChatInput feature flag are enabled (and the widget is not suppressed). When false, Duck.ai contextual and full modes fall back to the web input.
Observes whether the native input field user setting is enabled.
Emits the tab id whenever an end-voice-session action is requested (e.g. from the foreground service notification). Tabs should collect this flow and dispatch the end-voice-session JS event when their id is emitted.
Records that the user selected the "Search + Duck.ai" option on the new address bar picker, so the first prompt submitted from the Duck.ai toggle input field within the attribution window can be attributed back to the picker.
Opens the DuckChat WebView with optional pre-filled String query.
Auto-prompts the DuckChat WebView with the provided String query.
Opens Duck Chat with a prefilled String query.
Opens Duck.ai directly in voice mode (duck.ai/?mode=voice-mode).
Set user preference for whether chat suggestions are shown in the input screen.
Cosmetically sets the input screen user setting.
Set user setting to determine whether dedicated Duck.ai input screen with a mode switch should be used.
Returns true if Duck Chat was ever opened before.