From 78dbdcd8eee7f29e32149369f09b22c103a1391d Mon Sep 17 00:00:00 2001 From: amaitland Date: Wed, 23 Sep 2015 09:11:36 +1000 Subject: [PATCH 1/8] Update CI build to 45 Update another 43 reference to 43 in Home.html --- CefSharp.Example/Resources/Home.html | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CefSharp.Example/Resources/Home.html b/CefSharp.Example/Resources/Home.html index 1e5a0a6c5..ab30f3ebb 100644 --- a/CefSharp.Example/Resources/Home.html +++ b/CefSharp.Example/Resources/Home.html @@ -207,7 +207,7 @@

Support for both x86 and x64

- Chromium 43 supports both x86 and x64, and so do we as of CefSharp 43.0.0 For the time being, it does not + Chromium 45 supports both x86 and x64, and so do we as of CefSharp 45.0.0 For the time being, it does not "auto-detect" the platform being used (since this is quite complex), so you have to choose either one for your project. This practically means that you will have to compile & package separate binaries/installers of your app for x86 and x64 respectively if you want/need to support both of them. diff --git a/appveyor.yml b/appveyor.yml index b79c3cf72..97acaa388 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ environment: VisualStudioVersion: 11.0 -version: 43.0.0-CI{build} +version: 45.0.0-CI{build} shallow_clone: true From db7147ed3e518def89b41c40cc26df7784a8e4b0 Mon Sep 17 00:00:00 2001 From: amaitland Date: Wed, 23 Sep 2015 09:16:38 +1000 Subject: [PATCH 2/8] Upgrade VS environment variable in appveyor.yml (Not sure it's used as our custom build script takes care of version selection) --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 97acaa388..485dd244a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ environment: - VisualStudioVersion: 11.0 + VisualStudioVersion: 12.0 version: 45.0.0-CI{build} From f766d0d15b97f998979efbd498e0b5070bd836ef Mon Sep 17 00:00:00 2001 From: amaitland Date: Wed, 23 Sep 2015 09:18:35 +1000 Subject: [PATCH 3/8] Fix mistake in build.ps1 (change vs2012 to vs2013) --- build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.ps1 b/build.ps1 index a0fb8ff43..98ee17a9e 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,7 +1,7 @@ param( [ValidateSet("vs2013", "vs2015", "nupkg-only")] [Parameter(Position = 0)] - [string] $Target = "vs2012", + [string] $Target = "vs2013", [Parameter(Position = 1)] [string] $Version = "45.0.0", [Parameter(Position = 2)] From 8a725bcd7b2982e7284504a6e295851d23897a4f Mon Sep 17 00:00:00 2001 From: Haraguroicha Date: Wed, 23 Sep 2015 12:27:51 +0800 Subject: [PATCH 4/8] let cef.sdk reference from SolutionDir\packages not project relative parent --- .../CefSharp.BrowserSubprocess.Core.vcxproj | 2 +- CefSharp.Core/CefSharp.Core.vcxproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj index c8b419011..ae3a195c6 100644 --- a/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj +++ b/CefSharp.BrowserSubprocess.Core/CefSharp.BrowserSubprocess.Core.vcxproj @@ -1,6 +1,6 @@  - + Debug diff --git a/CefSharp.Core/CefSharp.Core.vcxproj b/CefSharp.Core/CefSharp.Core.vcxproj index 1dc07bb3d..47eff1129 100644 --- a/CefSharp.Core/CefSharp.Core.vcxproj +++ b/CefSharp.Core/CefSharp.Core.vcxproj @@ -1,6 +1,6 @@  - + Debug From a6fa598bac90cb799bf3bbff80b23158c980d524 Mon Sep 17 00:00:00 2001 From: Alex Maitland Date: Thu, 24 Sep 2015 19:12:26 +1000 Subject: [PATCH 5/8] Update README.md Move CefSharp1 details into their own section Reorder a few parts Add contributing.md reference int he hopes that people will actually read it. --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 07dc08efa..702981fb3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # CefSharp - Embedded Chromium for .NET -This project contains .NET CLR bindings for The [Chromium Embedded Framework (CEF)](https://bitbucket.org/chromiumembedded/cef) by Marshall A. Greenblatt. A small [Core](https://github.com/cefsharp/CefSharp/tree/master/CefSharp.Core) of the bindings are written in C++/CLI but the majority of code here is C#. It can of course be used from any CLR language, e.g. C# or VB. +This project contains .NET CLR bindings for The [Chromium Embedded Framework (CEF)](https://bitbucket.org/chromiumembedded/cef) by Marshall A. Greenblatt. A small [Core](https://github.com/cefsharp/CefSharp/tree/master/CefSharp.Core) of the bindings are written in C++/CLI but the majority of code here is C#. It can of course be used from any CLR language, e.g. C# or VB. [The CefSharp GitHub project page](https://github.com/cefsharp/CefSharp) is the recommended starting place. This is the `official` CefSharp fork, as maintained by the CefSharp community. You can also view [the entire network of public forks/branches](https://github.com/cefsharp/CefSharp/network). CefSharp provides both WPF and WinForms web browser control implementations. See the [CefSharp.Wpf.Example](https://github.com/cefsharp/CefSharp/tree/master/CefSharp.Wpf.Example) or [CefSharp.WinForms.Example](https://github.com/cefsharp/CefSharp/tree/master/CefSharp.WinForms.Example) projects for example web browsers built using this library; they are (at this moment) the best "documentation" of features. In addition see the [CefSharp.MinimalExample](https://github.com/cefsharp/CefSharp.MinimalExample/) repo for how CefSharp can actually be used via NuGet packages. @@ -8,7 +8,7 @@ This project is [BSD](http://www.opensource.org/licenses/bsd-license.php "BSD Li # Documentation, Contact etc. -Apart from code samples mentioned above work-in-progress documentation can be found [in the wiki](https://github.com/cefsharp/CefSharp/wiki). If something is missing/incomplete, please don't hesitate to ask on the [CefSharp Google Group](https://groups.google.com/forum/#!forum/cefsharp). You might also find help by searching the archive to that same Google Group for previous questions. +Apart from code samples mentioned above work-in-progress documentation can be found [in the wiki](https://github.com/cefsharp/CefSharp/wiki). If something is missing/incomplete, please don't hesitate to ask on the [CefSharp Google Group](https://groups.google.com/forum/#!forum/cefsharp). You might also find help by searching the archive to that same Google Group for previous questions. Before opening an issue or submitting a `PR` please read [Contributing.md](https://github.com/cefsharp/CefSharp/blob/master/CONTRIBUTING.md) # NuGet Packages @@ -27,16 +27,12 @@ Every commit on `master` produces a `Nuget` package. Use at your own risk! [CefS [WinForms](http://www.nuget.org/packages/CefSharp.WinForms/) or [OffScreen](http://www.nuget.org/packages/CefSharp.OffScreen/) now **including** JS Binding. -**Ultra stable/LTS** Read "He's dead Jim", based on Chromium 25. See the [CefSharp1](https://github.com/cefsharp/CefSharp/tree/CefSharp1#binary-release) branch README for CefSharp1 info. Please note that this version is no longer supported. - # Branches & Forks ![](http://img.shields.io/appveyor/ci/cefsharp/cefsharp.svg) * Development is done in the `master` branch. New features are preferably added in feature branches, if the changes are more than trivial. * When a new release is imminent a `version` branch is created. We try to avoid making public facing `API` changes in release branches (Adding new features is fine, just not breaking changes). -* Ultra-stable/LTS sources are in `CefSharp1`. -* [The CefSharp GitHub project page](https://github.com/cefsharp/CefSharp) is the recommended starting place. This is the "official" CefSharp fork, as maintained by the CefSharp community. You can also view [the entire network of public forks/branches](https://github.com/cefsharp/CefSharp/network). ### Version Branches @@ -48,6 +44,10 @@ Every commit on `master` produces a `Nuget` package. Use at your own risk! [CefS | [cefsharp/39](https://github.com/cefsharp/CefSharp/tree/cefsharp/39) | 2171 | 2012 | 4.0 | | [cefsharp/37](https://github.com/cefsharp/CefSharp/tree/cefsharp/37) | 2062 | 2012 | 4.0 | +#### CefSharp1 + +**Ultra stable/LTS** Read "He's dead Jim", based on Chromium 25. See the [CefSharp1](https://github.com/cefsharp/CefSharp/tree/CefSharp1#binary-release) branch README for CefSharp1 info. Please note that this version is no longer developed or supported. + # Links - [CefGlue](https://bitbucket.org/xilium/xilium.cefglue/): An alternative .NET CEF wrapper built using P/Invoke. From 77796eb3750be9cc770a358b0208328103b8ca9a Mon Sep 17 00:00:00 2001 From: amaitland Date: Fri, 25 Sep 2015 07:45:39 +1000 Subject: [PATCH 6/8] CefPdfPrintCallbackWrapper was not included in vcxproj --- CefSharp.Core/CefSharp.Core.vcxproj | 1 + CefSharp.Core/CefSharp.Core.vcxproj.filters | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CefSharp.Core/CefSharp.Core.vcxproj b/CefSharp.Core/CefSharp.Core.vcxproj index 47eff1129..576a1799e 100644 --- a/CefSharp.Core/CefSharp.Core.vcxproj +++ b/CefSharp.Core/CefSharp.Core.vcxproj @@ -259,6 +259,7 @@ + diff --git a/CefSharp.Core/CefSharp.Core.vcxproj.filters b/CefSharp.Core/CefSharp.Core.vcxproj.filters index 56beb8ec4..5fe5f4841 100644 --- a/CefSharp.Core/CefSharp.Core.vcxproj.filters +++ b/CefSharp.Core/CefSharp.Core.vcxproj.filters @@ -235,6 +235,9 @@ Header Files + + Header Files + From 5e2546067bfbea524de77c3e7fa439249a36bf88 Mon Sep 17 00:00:00 2001 From: amaitland Date: Fri, 25 Sep 2015 11:38:42 +1000 Subject: [PATCH 7/8] Change CefRequestWrapper to return null when PostData is null; --- CefSharp.Core/Internals/CefRequestWrapper.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CefSharp.Core/Internals/CefRequestWrapper.cpp b/CefSharp.Core/Internals/CefRequestWrapper.cpp index 46c374d6c..3fc9fcfc1 100644 --- a/CefSharp.Core/Internals/CefRequestWrapper.cpp +++ b/CefSharp.Core/Internals/CefRequestWrapper.cpp @@ -76,7 +76,11 @@ namespace CefSharp { if (_postData == nullptr) { - _postData = gcnew CefPostDataWrapper(_wrappedRequest->GetPostData()); + auto postData = _wrappedRequest->GetPostData(); + if (postData.get()) + { + _postData = gcnew CefPostDataWrapper(postData); + } } return _postData; } From 2153c51d156a9891cfd380554abd2a1263be4f3b Mon Sep 17 00:00:00 2001 From: amaitland Date: Fri, 25 Sep 2015 11:40:51 +1000 Subject: [PATCH 8/8] Add PostData null checks to examples Add basic ajax post example for custom scheme handler test page/handler --- CefSharp.Example/CefSharpSchemeHandler.cs | 22 +++++++ CefSharp.Example/RequestHandler.cs | 15 +++-- CefSharp.Example/Resources/SchemeTest.html | 72 +++++++++++++++++----- 3 files changed, 89 insertions(+), 20 deletions(-) diff --git a/CefSharp.Example/CefSharpSchemeHandler.cs b/CefSharp.Example/CefSharpSchemeHandler.cs index 553d3ff8c..45a65f247 100644 --- a/CefSharp.Example/CefSharpSchemeHandler.cs +++ b/CefSharp.Example/CefSharpSchemeHandler.cs @@ -63,6 +63,28 @@ namespace CefSharp.Example return true; } + if (string.Equals(fileName, "/PostDataAjaxTest.html", StringComparison.OrdinalIgnoreCase)) + { + var postData = request.PostData; + if(postData == null) + { + var resourceHandler = ResourceHandler.FromString("Post Data: null"); + stream = (MemoryStream)resourceHandler.Stream; + mimeType = "text/html"; + callback.Continue(); + } + else + { + var postDataElement = postData.Elements.FirstOrDefault(); + var resourceHandler = ResourceHandler.FromString("Post Data: " + (postDataElement == null ? "null" : postDataElement.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/RequestHandler.cs b/CefSharp.Example/RequestHandler.cs index 8725f074e..53c8205f4 100644 --- a/CefSharp.Example/RequestHandler.cs +++ b/CefSharp.Example/RequestHandler.cs @@ -68,15 +68,18 @@ namespace CefSharp.Example { using (var postData = request.PostData) { - var elements = postData.Elements; + if(postData != null) + { + var elements = postData.Elements; - var charSet = request.GetCharSet(); + var charSet = request.GetCharSet(); - foreach (var element in elements) - { - if (element.Type == PostDataElementType.Bytes) + foreach (var element in elements) { - var body = element.GetBody(charSet); + if (element.Type == PostDataElementType.Bytes) + { + var body = element.GetBody(charSet); + } } } } diff --git a/CefSharp.Example/Resources/SchemeTest.html b/CefSharp.Example/Resources/SchemeTest.html index cbabe4543..478fd739e 100644 --- a/CefSharp.Example/Resources/SchemeTest.html +++ b/CefSharp.Example/Resources/SchemeTest.html @@ -1,18 +1,62 @@  - - Scheme Handler Test - - -

Success

-

Scheme Handler Functioned Correctly

+ + Scheme Handler Test -
- User: -
- Pass: -
- -
- + + + +

Success

+

Scheme Handler Functioned Correctly

+ +
+ User: +
+ Pass: +
+ +
+ +

Custom Post using Ajax

+ + \ No newline at end of file