Condividi tramite


Recall linee guida per sviluppatori di Web browser

Molti Web browser supportano un concetto di esplorazione "InPrivate", in cui la cronologia dell'utente non viene salvata.

Per assicurarsi che Recall non salvi la cronologia di esplorazione dell'utente in modalità come questa, l'app può usare la SetInputScope funzione , impostando l'ambito di input su IS_PASSWORD.

Importante

Perché http supporti il comportamento descritto in questo articolo, la tua app deve anche avere registrato un gestore di protocolli https o SetInputScope.

[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);
}

L'app deve sospendere la fornitura di attività utente mentre l'utente è in modalità di esplorazione "privata".