SEBWIN-106: Fixed loading / rendering issues with favicons and application instance button and enabled popups for default settings.
This commit is contained in:
parent
0ee13c9c8b
commit
483eec6ef8
8 changed files with 66 additions and 9 deletions
|
@ -61,11 +61,11 @@ namespace SafeExamBrowser.Browser
|
|||
var cefSettings = InitializeCefSettings();
|
||||
var success = Cef.Initialize(cefSettings, true, null);
|
||||
|
||||
logger.Info("Initialized browser engine.");
|
||||
logger.Info("Initialized browser.");
|
||||
|
||||
if (!success)
|
||||
{
|
||||
throw new Exception("Failed to initialize the browser engine!");
|
||||
throw new Exception("Failed to initialize browser!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ namespace SafeExamBrowser.Browser
|
|||
|
||||
Cef.Shutdown();
|
||||
|
||||
logger.Info("Terminated browser engine.");
|
||||
logger.Info("Terminated browser.");
|
||||
}
|
||||
|
||||
private void CreateNewInstance(BrowserSettings custom = null)
|
||||
|
@ -127,10 +127,10 @@ namespace SafeExamBrowser.Browser
|
|||
UserAgent = settings.UseCustomUserAgent ? settings.CustomUserAgent : string.Empty
|
||||
};
|
||||
|
||||
logger.Debug($"Browser cache path: {cefSettings.CachePath}");
|
||||
logger.Debug($"Browser log file: {cefSettings.LogFile}");
|
||||
logger.Debug($"Browser log severity: {cefSettings.LogSeverity}");
|
||||
logger.Debug($"Browser engine version: Chromium {Cef.ChromiumVersion}, CEF {Cef.CefVersion}, CefSharp {Cef.CefSharpVersion}");
|
||||
logger.Debug($"Cache path: {cefSettings.CachePath}");
|
||||
logger.Debug($"Engine version: Chromium {Cef.ChromiumVersion}, CEF {Cef.CefVersion}, CefSharp {Cef.CefSharpVersion}");
|
||||
logger.Debug($"Log file: {cefSettings.LogFile}");
|
||||
logger.Debug($"Log severity: {cefSettings.LogSeverity}");
|
||||
|
||||
return cefSettings;
|
||||
}
|
||||
|
|
|
@ -95,6 +95,7 @@ namespace SafeExamBrowser.Client
|
|||
|
||||
var operations = new Queue<IOperation>();
|
||||
|
||||
operations.Enqueue(new InitializationOperation(logger));
|
||||
operations.Enqueue(new I18nOperation(logger, text, textResource));
|
||||
operations.Enqueue(new RuntimeConnectionOperation(logger, runtimeProxy, startupToken));
|
||||
operations.Enqueue(new ConfigurationOperation(configuration, logger, runtimeProxy));
|
||||
|
|
50
SafeExamBrowser.Client/Operations/InitializationOperation.cs
Normal file
50
SafeExamBrowser.Client/Operations/InitializationOperation.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright (c) 2019 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.Net;
|
||||
using SafeExamBrowser.Contracts.Core.OperationModel;
|
||||
using SafeExamBrowser.Contracts.Core.OperationModel.Events;
|
||||
using SafeExamBrowser.Contracts.I18n;
|
||||
using SafeExamBrowser.Contracts.Logging;
|
||||
|
||||
namespace SafeExamBrowser.Client.Operations
|
||||
{
|
||||
internal class InitializationOperation : IOperation
|
||||
{
|
||||
private ILogger logger;
|
||||
|
||||
public event ActionRequiredEventHandler ActionRequired { add { } remove { } }
|
||||
public event StatusChangedEventHandler StatusChanged;
|
||||
|
||||
public InitializationOperation(ILogger logger)
|
||||
{
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
public OperationResult Perform()
|
||||
{
|
||||
logger.Info("Initializing client application...");
|
||||
StatusChanged?.Invoke(TextKey.OperationStatus_InitializeClient);
|
||||
|
||||
ConfigureSecurityProtocols();
|
||||
|
||||
return OperationResult.Success;
|
||||
}
|
||||
|
||||
public OperationResult Revert()
|
||||
{
|
||||
return OperationResult.Success;
|
||||
}
|
||||
|
||||
private void ConfigureSecurityProtocols()
|
||||
{
|
||||
// Enables the security protocols specified below for all web requests which are made during application runtime.
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12 | SecurityProtocolType.Ssl3;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -74,6 +74,7 @@
|
|||
<Compile Include="ClientController.cs" />
|
||||
<Compile Include="Operations\ClientHostDisconnectionOperation.cs" />
|
||||
<Compile Include="Operations\ConfigurationOperation.cs" />
|
||||
<Compile Include="Operations\InitializationOperation.cs" />
|
||||
<Compile Include="Operations\RuntimeConnectionOperation.cs" />
|
||||
<Compile Include="Communication\ClientHost.cs" />
|
||||
<Compile Include="CompositionRoot.cs" />
|
||||
|
|
|
@ -97,6 +97,7 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
|
|||
settings.Browser.AllowDownloads = false;
|
||||
settings.Browser.AllowForwardNavigation = false;
|
||||
settings.Browser.AllowPageZoom = true;
|
||||
settings.Browser.AllowPopups = true;
|
||||
settings.Browser.AllowReloading = true;
|
||||
|
||||
settings.Keyboard.AllowAltEsc = false;
|
||||
|
|
|
@ -58,6 +58,7 @@ namespace SafeExamBrowser.Contracts.I18n
|
|||
OperationStatus_EmptyClipboard,
|
||||
OperationStatus_FinalizeServiceSession,
|
||||
OperationStatus_InitializeBrowser,
|
||||
OperationStatus_InitializeClient,
|
||||
OperationStatus_InitializeConfiguration,
|
||||
OperationStatus_InitializeKioskMode,
|
||||
OperationStatus_InitializeProcessMonitoring,
|
||||
|
|
|
@ -126,6 +126,9 @@
|
|||
<Entry key="OperationStatus_InitializeBrowser">
|
||||
Initializing browser
|
||||
</Entry>
|
||||
<Entry key="OperationStatus_InitializeClient">
|
||||
Initializing client application
|
||||
</Entry>
|
||||
<Entry key="OperationStatus_InitializeConfiguration">
|
||||
Initializing application configuration
|
||||
</Entry>
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
<Grid>
|
||||
<Button x:Name="Button" Background="Transparent" Click="Button_Click" Height="40" Padding="10" Template="{StaticResource TaskbarButton}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ContentControl x:Name="Icon" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0,0,10,0" />
|
||||
<TextBlock x:Name="Text" HorizontalAlignment="Left" VerticalAlignment="Center" Padding="5" />
|
||||
<ContentControl x:Name="Icon" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0,0,10,0" Width="20" />
|
||||
<TextBlock x:Name="Text" HorizontalAlignment="Left" VerticalAlignment="Center" Padding="5" MaxWidth="350" TextTrimming="CharacterEllipsis" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
|
Loading…
Reference in a new issue