diff --git a/CefSharp.Example/CefExample.cs b/CefSharp.Example/CefExample.cs index bce3c8d8a..a76a565fa 100644 --- a/CefSharp.Example/CefExample.cs +++ b/CefSharp.Example/CefExample.cs @@ -17,6 +17,7 @@ namespace CefSharp.Example public const string BindingTestUrl = "custom://cefsharp/BindingTest.html"; public const string PluginsTestUrl = "custom://cefsharp/plugins.html"; public const string PopupTestUrl = "custom://cefsharp/PopupTest.html"; + public const string BasicSchemeTestUrl = "custom://cefsharp/SchemeTest.html"; public const string TestResourceUrl = "http://test/resource/load"; public const string RenderProcessCrashedUrl = "http://processcrashed"; public const string TestUnicodeResourceUrl = "http://test/resource/loadUnicode"; diff --git a/CefSharp.Example/CefSharpSchemeHandler.cs b/CefSharp.Example/CefSharpSchemeHandler.cs index eb3f2f7af..0508a42e6 100644 --- a/CefSharp.Example/CefSharpSchemeHandler.cs +++ b/CefSharp.Example/CefSharpSchemeHandler.cs @@ -51,6 +51,15 @@ namespace CefSharp.Example var uri = new Uri(request.Url); var fileName = uri.AbsolutePath; + if(string.Equals(fileName, "/PostDataTest.html", StringComparison.OrdinalIgnoreCase)) + { + var resourceHandler = ResourceHandler.FromString("Post Data: " + request.PostData.Elements[0].GetBody()); + stream = (MemoryStream)resourceHandler.Stream; + mimeType = "text/html"; + callback.Continue(); + return true; + } + string resource; if (ResourceDictionary.TryGetValue(fileName, out resource) && !string.IsNullOrEmpty(resource)) { diff --git a/CefSharp.Example/Resources/SchemeTest.html b/CefSharp.Example/Resources/SchemeTest.html index c2c143d86..cbabe4543 100644 --- a/CefSharp.Example/Resources/SchemeTest.html +++ b/CefSharp.Example/Resources/SchemeTest.html @@ -1,10 +1,18 @@ -
-Scheme Handler Functioned Correctly
- + +Scheme Handler Functioned Correctly
+ + + \ No newline at end of file diff --git a/CefSharp.Wpf.Example/MainWindow.xaml b/CefSharp.Wpf.Example/MainWindow.xaml index 552ab695f..d1b1a286e 100644 --- a/CefSharp.Wpf.Example/MainWindow.xaml +++ b/CefSharp.Wpf.Example/MainWindow.xaml @@ -20,6 +20,7 @@ + diff --git a/CefSharp.Wpf.Example/MainWindow.xaml.cs b/CefSharp.Wpf.Example/MainWindow.xaml.cs index 7e0bd4f15..e9d22997d 100644 --- a/CefSharp.Wpf.Example/MainWindow.xaml.cs +++ b/CefSharp.Wpf.Example/MainWindow.xaml.cs @@ -121,6 +121,11 @@ namespace CefSharp.Wpf.Example url = CefExample.PopupTestUrl; break; } + case "BasicSchemeTest": + { + url = CefExample.BasicSchemeTestUrl; + break; + } } if (string.IsNullOrEmpty(url)) diff --git a/CefSharp/PostDataExtensions.cs b/CefSharp/PostDataExtensions.cs index f3c19d45a..ea1dcbe87 100644 --- a/CefSharp/PostDataExtensions.cs +++ b/CefSharp/PostDataExtensions.cs @@ -75,7 +75,7 @@ namespace CefSharp /// post data /// character set ///