/*
* Copyright (c) 2023 ETH Zürich, Educational Development and Technology (LET)
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
using System;
namespace SafeExamBrowser.Settings.Browser
{
///
/// Defines all settings for the integrated browser application.
///
[Serializable]
public class BrowserSettings
{
///
/// The settings to be used for additional browser windows.
///
public WindowSettings AdditionalWindow { get; set; }
///
/// Determines whether the user will be allowed to download configuration files.
///
public bool AllowConfigurationDownloads { get; set; }
///
/// Determines whether the user will be allowed to select a custom location when down- or uploading a file (excluding configuration files).
///
public bool AllowCustomDownAndUploadLocation { get; set; }
///
/// Determines whether the user will be allowed to download files (excluding configuration files).
///
public bool AllowDownloads { get; set; }
///
/// Determines whether the user will be allowed to search page contents.
///
public bool AllowFind { get; set; }
///
/// Determines whether the user will be allowed to zoom webpages.
///
public bool AllowPageZoom { get; set; }
///
/// Determines whether the internal PDF reader of the browser application is enabled. If not, documents will be downloaded by default.
///
public bool AllowPdfReader { get; set; }
///
/// Determines whether the toolbar of the internal PDF reader (which allows to e.g. download or print a document) will be enabled.
///
public bool AllowPdfReaderToolbar { get; set; }
///
/// Determines whether the user will be allowed to print web content. To control printing in PDF documents, see .
///
public bool AllowPrint { get; set; }
///
/// Determines whether spell checking is enabled for input fields.
///
public bool AllowSpellChecking { get; set; }
///
/// Determines whether the user will be allowed to upload files.
///
public bool AllowUploads { get; set; }
///
/// The salt value for the calculation of the browser exam key which is used for integrity checks with server applications (see also ).
///
public byte[] BrowserExamKeySalt { get; set; }
///
/// The configuration key used for integrity checks with server applications (see also ).
///
public string ConfigurationKey { get; set; }
///
/// Determines whether the user needs to confirm the termination of SEB by .
///
public bool ConfirmQuitUrl { get; set; }
///
/// An optional, custom browser exam key used for integrity checks with server applications (see also ).
///
public string CustomBrowserExamKey { get; set; }
///
/// The custom user agent to optionally be used for all requests.
///
public string CustomUserAgent { get; set; }
///
/// Determines whether the entire browser cache is deleted when terminating the application. IMPORTANT: If
/// is set to false, the cache will not be deleted in order to keep the cookies for the next session.
///
public bool DeleteCacheOnShutdown { get; set; }
///
/// Determines whether all cookies are deleted when terminating the browser application. IMPORTANT: The browser cache will not be deleted
/// if set to false, even if is set to true!
///
public bool DeleteCookiesOnShutdown { get; set; }
///
/// Determines whether all cookies are deleted when starting the browser application.
///
public bool DeleteCookiesOnStartup { get; set; }
///
/// Defines a custom directory for down- and uploads. If not defined, all operations will be directed to the current user's download directory.
///
public string DownAndUploadDirectory { get; set; }
///
/// Determines whether the user is allowed to use the integrated browser application.
///
public bool EnableBrowser { get; set; }
///
/// The settings to be used for the browser request filter.
///
public FilterSettings Filter { get; set; }
///
/// An optional custom message shown before navigating home.
///
public string HomeNavigationMessage { get; set; }
///
/// Determines whether a password is required to navigate home.
///
public bool HomeNavigationRequiresPassword { get; set; }
///
/// The hash code of the password optionally required to navigate home.
///
public string HomePasswordHash { get; set; }
///
/// An optional custom URL to be used when navigating home.
///
public string HomeUrl { get; set; }
///
/// The settings to be used for the main browser window.
///
public WindowSettings MainWindow { get; set; }
///
/// Determines how attempts to open a popup are handled.
///
public PopupPolicy PopupPolicy { get; set; }
///
/// Determines the proxy settings to be used by the browser.
///
public ProxySettings Proxy { get; set; }
///
/// An URL which will initiate the termination of SEB (or reset the browser if is true) when visited by the user.
///
public string QuitUrl { get; set; }
///
/// Determines whether the browser should be reset when a is detected.
///
public bool ResetOnQuitUrl { get; set; }
///
/// Determines whether the configuration key header is sent with every HTTP request (see also ).
///
public bool SendConfigurationKey { get; set; }
///
/// Determines whether the browser exam key header is sent with every HTTP request (see also and ).
///
public bool SendBrowserExamKey { get; set; }
///
/// Determines whether the user will be able to see the path of a file system element in the file system dialog (e.g. when down- or uploading a file).
///
public bool ShowFileSystemElementPath { get; set; }
///
/// The URL with which the main browser window will be loaded.
///
public string StartUrl { get; set; }
///
/// A query for the which SEB automatically extracts from the configuration URL.
///
public string StartUrlQuery { get; set; }
///
/// Determines whether a custom user agent will be used for all requests, see .
///
public bool UseCustomUserAgent { get; set; }
///
/// Determines whether the will be appended to the .
///
public bool UseQueryParameter { get; set; }
///
/// A custom suffix to be appended to the user agent.
///
public string UserAgentSuffix { get; set; }
///
/// Determines whether the start URL will be used when navigating home.
///
public bool UseStartUrlAsHomeUrl { get; set; }
///
/// Determines whether a temporary directory should be used for down- and uploads.
///
public bool UseTemporaryDownAndUploadDirectory { get; set; }
public BrowserSettings()
{
AdditionalWindow = new WindowSettings();
Filter = new FilterSettings();
MainWindow = new WindowSettings();
Proxy = new ProxySettings();
}
}
}