From a82f2d5780dd3c7638779a54fc05ee8a030cd75f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20B=C3=BCchel?= Date: Thu, 6 Aug 2020 14:26:40 +0200 Subject: [PATCH] SEBWIN-416: Ensured third-party applications with custom URI schemes are correctly opened. --- SafeExamBrowser.Browser/BrowserApplicationInstance.cs | 4 ++++ SafeExamBrowser.Browser/Handlers/ResourceHandler.cs | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/SafeExamBrowser.Browser/BrowserApplicationInstance.cs b/SafeExamBrowser.Browser/BrowserApplicationInstance.cs index 6d35b5b1..a3f6f088 100644 --- a/SafeExamBrowser.Browser/BrowserApplicationInstance.cs +++ b/SafeExamBrowser.Browser/BrowserApplicationInstance.cs @@ -233,6 +233,10 @@ namespace SafeExamBrowser.Browser { logger.Info($"Request for '{url}' was aborted."); } + else if (errorCode == (int) CefErrorCode.UnknownUrlScheme) + { + logger.Info($"Request for '{url}' contains unknown URL scheme and will be handled by the OS."); + } else { var title = text.Get(TextKey.Browser_LoadErrorPageTitle); diff --git a/SafeExamBrowser.Browser/Handlers/ResourceHandler.cs b/SafeExamBrowser.Browser/Handlers/ResourceHandler.cs index a15bdd0c..b8821be2 100644 --- a/SafeExamBrowser.Browser/Handlers/ResourceHandler.cs +++ b/SafeExamBrowser.Browser/Handlers/ResourceHandler.cs @@ -77,6 +77,11 @@ namespace SafeExamBrowser.Browser.Handlers return base.OnBeforeResourceLoad(webBrowser, browser, frame, request, callback); } + protected override bool OnProtocolExecution(IWebBrowser webBrowser, IBrowser browser, IFrame frame, IRequest request) + { + return true; + } + protected override void OnResourceRedirect(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, IResponse response, ref string newUrl) { SearchSessionIdentifiers(response);