@duckduckgo/content-scope-scripts
    Preparing search index...

    Class OnboardingPage

    This describes the messages that will be sent to the native layer,

    Index
    injectName:
        | "firefox"
        | "apple"
        | "apple-isolated"
        | "apple-broker-protection"
        | "apple-ai-clear"
        | "apple-ai-history"
        | "apple-page-translation"
        | "android"
        | "windows"
        | "integration"
        | "chrome-mv3"
        | "android-broker-protection"
        | "android-autofill-import"
        | "android-adsjs"
        | "android-ai-history"
        | "android-ai-clear"
        | "android-page-translation"
        | undefined
    notify: <
        Method extends
            | "reportInitException"
            | "reportPageException"
            | "telemetryEvent"
            | "addFavorites"
            | "dismissToAddressBar"
            | "dismissToSettings"
            | "requestChromeExtensionInstall"
            | "setAdBlocking"
            | "setBookmarksBar"
            | "setDuckAiInAddressBar"
            | "setOnboardingInstallOptions"
            | "setSessionRestore"
            | "setShowHomeButton"
            | "stepCompleted"
            | "submitQuery",
        Msg = | Extract<AddFavoritesNotification, { method: Method }>
        | Extract<DismissToAddressBarNotification, { method: Method }>
        | Extract<DismissToSettingsNotification, { method: Method }>
        | Extract<ReportInitExceptionNotification, { method: Method }>
        | Extract<ReportPageExceptionNotification, { method: Method }>
        | Extract<RequestChromeExtensionInstallNotification, { method: Method }>
        | Extract<SetAdBlockingNotification, { method: Method }>
        | Extract<SetBookmarksBarNotification, { method: Method }>
        | Extract<SetDuckAiInAddressBarNotification, { method: Method }>
        | Extract<SetOnboardingInstallOptionsNotification, { method: Method }>
        | Extract<SetSessionRestoreNotification, { method: Method }>
        | Extract<SetShowHomeButtonNotification, { method: Method }>
        | Extract<StepCompletedNotification, { method: Method }>
        | Extract<SubmitQueryNotification, { method: Method }>
        | Extract<TelemetryEventNotification, { method: Method }>,
    >(
        ...args: Msg extends { params: Params } ? [Method, Params] : [Method],
    ) => void
    request: <
        Method extends
            | "init"
            | "requestSetAsDefault"
            | "requestImport"
            | "requestDockOptIn"
            | "shouldShowTopSitesPicker",
        Msg = | Extract<InitRequest, { method: Method }>
        | Extract<RequestDockOptInRequest, { method: Method }>
        | Extract<RequestImportRequest, { method: Method }>
        | Extract<RequestSetAsDefaultRequest, { method: Method }>
        | Extract<ShouldShowTopSitesPickerRequest, { method: Method }>,
        Return = Msg extends { result: Result } ? Result : void,
    >(
        ...args: Msg extends { params: Params } ? [Method, Params] : [Method],
    ) => Promise<Return>
    subscribe: <
        Method extends "onConfigUpdate",
        Msg = Extract<OnConfigUpdateSubscription, { subscriptionEvent: Method }>,
        Callback = Msg extends { params: Params }
            ? (params: Params) => void
            : (a: never) => void,
    >(
        subscriptionEvent: Method,
        cb: Callback,
    ) => () => void
    • Sends an initial message to the native layer. This is the opportunity for the native layer to provide the initial state of the application or any configuration, for example:

      {
      "stepDefinitions": {
      "systemSettings": {
      "rows": ["dock", "import", "default-browser"]
      }
      },
      "steps": ["welcome", "getStarted", "makeDefaultSingle", "systemSettings", "customize", "addressBarMode", "searchOrChat"],
      "locale": "en"
      }

      In that example, the native layer is providing the list of rows that should be shown in the systemSettings step, overriding the default list provided in data.js.

      Clients that don't send steps can still send exclude to remove steps from the default order. It's ignored when steps is present, and will be removed once every platform sends steps.

      Returns Promise<InitResponse>

    • Sent when the user opts in to installing the Chrome search extension during onboarding. The UI advances immediately without waiting for the install to complete.

      Returns void

    • Sent when the user wants to keep the application in the dock/taskbar.

      Native side should respond when the operation is 'complete'.

      Returns Promise<{ [k: string]: unknown }>

    • Sent when the user wants to set DuckDuckGo as their default browser. The UI will remain in a loading state until the native layer sends a response.

      Native side should respond when the operation is 'complete'.

      Returns Promise<{ [k: string]: unknown }>