Delen via


Recall richtlijnen voor ontwikkelaars van webbrowsers

Veel webbrowsers ondersteunen een concept van InPrivate-navigatie, waarbij de geschiedenis van de gebruiker niet wordt opgeslagen.

Om ervoor te zorgen dat Recall de browsegeschiedenis van uw gebruiker niet wordt opgeslagen in modi zoals deze, kan uw app de SetInputScope functie gebruiken en het invoerbereik instellen op IS_PASSWORD.

Belangrijk

Uw app moet ook een http of https protocolhandler hebben geregistreerd voordat SetInputScope het gedrag wordt ondersteund dat in dit artikel wordt beschreven.

[DllImport("msctf.dll", SetLastError = true)]
private static extern int SetInputScope(IntPtr hwnd, InputScope inputScope);

private new enum InputScope : int
{
    IS_DEFAULT = 0,
    IS_URL = 1,
    IS_FILE_FULLFILEPATH = 2,
    IS_PRIVATE = 0x1f // Input is treated as private (e.g. passwords)
}

private void EnterInPrivateMode()
{
    // Get your HWND. This will vary based on your UI Framework. WPF can use WindowInteropHelper, passing in your current Window.
    IntPtr hwnd = new WindowInteropHelper(this).Handle;

    // Then, set the input scope on the HWND to private
    SetInputScope(hwnd, InputScope.IS_PRIVATE);
}

private void ExitInPrivateMode()
{
    // Get your HWND. This will vary based on your UI Framework. WPF can use WindowInteropHelper, passing in your current Window.
    IntPtr hwnd = new WindowInteropHelper(this).Handle;

    // Then, set the input scope on the HWND to default
    SetInputScope(hwnd, InputScope.IS_DEFAULT);
}

Uw app moet de gebruikersactiviteiten onderbreken terwijl de gebruiker zich in de 'privé'-browsermodus bevindt.