Commit Graph

611 Commits

Author SHA1 Message Date
Alex Maitland 3eca8bdba6 Enhancement - Simplify Setting of RequestContext Proxy (#3250)
Core - Simplify Setting of Proxy for new RequestContext

- Throw exception if requestContext.CanSetPreference returns false.
Proxy likely set via command line args.
- Add IRequestContext.SetPreferenceAsync
-  Test - Add SelfHosted Proxy
Use Titanium.Web.Proxy to self host a proxy for testing proxy settings
Only run Proxy Tests when run locally
- Add RequestContext Builder Fluent API
2020-10-13 13:40:46 +10:00
amaitland e149cabe07 Example - Move RequestContextHandler into CefSharp.Example
Was previously only in WPF project, move into the common CefSharp.Example
as there was nothing WPF specific out the class.
2020-10-02 10:25:23 +10:00
Alex Maitland 78e32a3b9f Enhancement - Add DevToolsClient (#3229)
* Core - Add DevToolsClient

Issue #3165

* DevTools Client - Add Network domain class

- Add hand written class to get a better sense of how the code should be structured.
- Improve exception handling

* Devtools - First draft of devtools protocol methods (generated)

Not complete yet

* Devtools - Simple method execution working

* DevTools - Add .Net Style cased property names to response objects

- Use internal field and datacontract attributes

* DevTools - Improve mapping

* DevTools - Strongly typed enums

* DevTools Client - Generated from active browser instance (M84)

* Devtools Client - Extract IDevToolsClient interface for testability

Improve xml doc comments

* DevTools Client - Improve error handling

* DevTools Client - Improve enum conversion

* Revert to older c# syntax

* DevTools Client - Fix failing tests

* Devtools Client - Add SetCookie Tests

* DevTools Client - Add Capture SyncContext by default

- Add option to capture the SyncContext
- Add option to provide custom SyncContext (can just pass in UI SyncContext and all continuations will happen there).
- Fix bug in ExecuteDevToolsMethodAsync sending the command twice when exeucted on the CEF UI thread

* Devtools Client - Add missing file reference

The problem with developing with the .Net Core project where files are automatically included is you
forget to include them in the regular csproj file.

* Devtools Client - Add CanCanEmulate Test case

* DevTools Client - Add AddScriptToEvaluateOnNewDocumentAsync test

* DevTools Client - OnDevToolsEvent only parse data if event handler != null

* DevTools Client - GetDevToolsClient remove ThrowExceptionIfDisposed/ThrowExceptionIfBrowserNotInitialized calls

Those methods were removed as the GetBrowser call handles the checks for us.

* DevTools Client - Improve error handling

* DevTools Client - Update xml doc comments

* DevTools Client - Add validation method (partial)

Add ability to manually add validation logic

* DevTools Client - Comment out failing test

Was working when targeting M84, now with M85 it fails.

The mapping appears to be correct, will need to investigate further

* OffScreen Example - Remove test code
2020-09-21 19:32:25 +10:00
amaitland 124490ed20 Core - Legacy Javascript Binding Integration Test
Post QUnitExecutionComplete on test completion

#2977
2020-09-16 20:31:06 +10:00
amaitland 3230444045 WPF Example - Add Chrome internal Urls menu
- Add new menu for testing/debugging purposes
2020-09-16 14:32:30 +10:00
amaitland 53f15f22eb Upgrade to CEF 85.3.6+gacfac2f+chromium-85.0.4183.102 / Chromium 85.0.4183.102
- Remove CefSettings.RegisterExtension (#3184)
- Add IRenderProcessHandler.OnWebKitInitialized
- Add Cef.RegisterExtension (Browser SubProcess specific implementation)

Resolves #3184
2020-09-16 13:49:37 +10:00
amaitland 1af1065f03 Net Core - Add XUnit Test Project
Issue #3197
2020-07-24 21:07:29 +10:00
amaitland 22d494b230 Net Core - Split Binding Test into Sync/Async
- In preparation for adding a Net Core Specific XUnit project file

Issue #3197
2020-07-24 20:42:14 +10:00
amaitland 4505fdfef4 Net Core - Ensure project build order and copy browsersubprocess files.
- Add new CefSharp.AfterBuild.targets to copy the cefsharp redist files and
- BrowserSubPorcess is now a build dependency of the Example projects
2020-07-24 19:51:43 +10:00
amaitland 857cfce80a Net Core Example - Move cef.redist package references from example into the individual projects. 2020-07-23 21:00:39 +10:00
amaitland e8cf336bf3 Net Core - Support for compiling with .Net Core 3.1
- Make Wpf/WinForms/OffScreen projects target AnyCPU
Only the VC++ projects are platform specific now.
- Remove BrowserSubProcess project reference
Not needed as we now have a standalone exe
- Add OffScreen example
- Add WPF Example project
- Fix some compile errors for main solution
- Add BrowserSubProcess executable
- JavascriptObjectRepository remove isAsync param
Rather than throw exception remove the option
- BrowserSubprocess Exclude the WCF specific code from the netCore project
- Add some ifdef/ifndef to exclude the WCF specific implementation
- Move WCF implementation into separate namespace
2020-07-23 15:23:45 +10:00
Konstantin Preißer 5e89f71a44 Add new projects targeting .NET Core 3.1 (#3181)
* Add .NET Core 3.1 projects for CefSharp, CefSharp.Core, CefSharp.BrowserSubprocess.Core, CefSharp.WinForms, CefSharp.Wpf, CefSharp.OffScreen.

Contributes to CefSharp#2796

* - Remove dependencies to "opengl32.lib" and "glu32.lib" which aren't available for ARM64 and don't seem to be needed.
- Clean up project files.

* Switch project CefSharp.netcore.csproj to AnyCPU as it doesn't require different builds for each platform.

* Remove WindowsTargetPlatformVersion property as that is declared in CefSharp.props.

* Use "bin.netcore" and "obj.netcore" as [intermediate] output path for the .NET Core projects, to allow side-by-side builds with the .NET Framework projects.

* Output documentation files.

* Add CefSharp.Example.netcore and CefSharp.WinForms.Example.netcore.

* Follow-up: Remove properties from the example projects that are also not used in the corresponding .NET Framework projects.
2020-07-23 15:21:14 +10:00
Alex Maitland 8d25b71490 Core - Re-Add IAudioHandler (#3153)
Resolves #3152
2020-07-08 08:06:16 +10:00
amaitland eee134c70f Example - Add DevToolsExtensions.CaptureScreenShotAsPng
Example of taking a screenshot as a png using the new devtools interface
2020-06-29 13:58:06 +10:00
amaitland 971b7671a6 Core - Allow overriding of enable-features command line arg
Added example of NetworkServiceInProcess

NOTE: Running the Network Service in Process is not something CEF officially supports
It may or may not work for newer versions.
2020-06-19 20:48:25 +10:00
amaitland ae41e10d71 Core - Javascript Binding Configure Property Name
- Rename settings object to JavascriptBindingSettings
- Validate JavascriptBindingSettings.JsBindingGlobalObjectName in setter to provide immediate
  feedback
- Add FreezableBase which throws exception when frozen (we can reuse this for some other settings classes)
- Add some basic Unit Tests (More would be better)

Follow on from #3126
2020-05-30 19:28:50 +10:00
amaitland e1401e7092 Core - Ensure CachePath/RootCachePath/LocalesDirPath/BrowserSubprocessPath are absolute
CEF now requires this to be absolute, we enforce this by throwing exception if non-absolute

Resolves  #3102
2020-05-03 16:59:57 +10:00
amaitland 349c9a938b Core - IResourceRequestHandler implement IDisposible
Add ResourceRequestHandler.Dispose protected virtual method
Instance will be disposed when ref count frees the last instance.
2020-05-02 08:50:16 +10:00
amaitland d82370eb14 Example - Add additional popup test
Also remove unused file
2020-05-01 11:00:45 +10:00
amaitland 4d7fa50c16 Example - Make BrowserSubProcess paths absolute
Issue #3102
2020-04-29 08:13:08 +10:00
amaitland 7e121305ae Example - Add AcceptRangeResourceHandler demo
CEF in theory now supports partial range requests see https://bitbucket.org/chromiumembedded/cef/issues/2873/streamreaderurlloader-doesnt-correctly

Not production tested, just a rough working prototype at this point in time. It's not clear that CEF
2020-04-23 17:10:37 +10:00
amaitland ea3b1398d0 Example - RegisterTestResources now registers resource if no factory found 2020-04-08 18:07:01 +10:00
amaitland 73e7c5de13 Core - Rename AbstractCefSettings to CefSettingsBase
This is a somewhat cosmetic change so the API Doc looks better, the
classes appear next to each other (CefSettings, CefSettingsBase)
when sorted alphabetically.

Resolves #3093
2020-04-06 14:59:33 +10:00
amaitland 2b47cf56ce Core - Make ResourceHandler.GetMimeType obsolete
Instead use Cef.GetMimeType to use the Chromium MimeType Mappings

Rather than maintain our own mapping (which is out of date) we'll defer to Chromium.

Make ResourceHandler.FromString(string, string) and ResourceHandler.GetMimeType obsolete, they will be removed at some point
ResourceHandler.FromString uses ResourceHandler.GetMimeType internally, Replacing with ResourceHandler.FromString(resource, mimeType: Cef.GetMimeType(extension));
uses a different overload.

Issue #3041
2020-03-26 08:50:08 +10:00
amaitland 344a9297dd Examples - Update ResourceHandler.GetMimeType to Cef.GetMimeType
Transition away from our incomplete implementation to using the Chromium mapping

Issue #3041
2020-03-26 08:50:07 +10:00
amaitland d693ece3ca Example - Fix more home.html links 2019-12-13 19:40:35 +10:00
amaitland c26053ae22 Example - Fix broken link in Home.html 2019-12-13 18:59:43 +10:00
amaitland a9d39d7965 Core - Add StreamResponseFilter
- Moved from the Cefsharp.Example.Filters.StreamResponseFilter
- Added CanWrite checks in InitFilter
- Updated example to reflect namespace change.
2019-12-10 18:31:38 +10:00
amaitland 1b5795cff7 CefSharp.Example - Add Disable WebAssembly example 2019-11-23 13:55:13 +10:00
amaitland ac07860cba CefExample - Add example of disable-site-isolation-trials command line arg 2019-11-23 06:47:29 +10:00
amaitland c925717cb0 ExampleRequestHandler - Improve GetAuthCredentials example 2019-10-04 11:29:33 +10:00
amaitland 647a072d67 ExampleRequestHandler - Improve OnCertificateError example 2019-10-04 10:47:59 +10:00
amaitland 446093b6c3 CefExample - Remove disable network service example
No longer possible to disable network service
2019-10-02 12:30:30 +10:00
amaitland 4a79b75726 IUrlRequest - Minor formatting and xml doc improvements
- Formatting
- Xml doc improvements
- Rewrite test case to run continuation async

Issue #2881
2019-10-01 20:44:46 +10:00
David M Iserovich a843407dab Core - Add IURLRequest #1721 (#2881)
* Core - Add IURLRequest #1721

Add IURLRequest, IURLRequestClient, and GetURLRequest to IFrame

* Rename URL classes to Url, add xmldoc and licenses

* Add UrlRequestClient to CefSharp.Example, more minor cleanup

* Getters

* Rebase tweaks

* Fix filenames, remove unused

* Use UnmanagedMemoryStream instead of byte array for IUrlRequestClient.OnDownloadData
2019-10-01 20:11:10 +10:00
amaitland 802bb7f43c Remove IAudioHandler
The Chromium implementation has changed so dramatically that CEF has removed support see https://bitbucket.org/chromiumembedded/cef/commits/1f893c76a97eaa88e3ff782b8e2e47dd0f5d27b2

Track https://bitbucket.org/chromiumembedded/cef/issues/2755/reimplement-audio-mirroring-for for details on when it will be reimplemented

Original Issue #2727
2019-10-01 20:06:37 +10:00
amaitland cc8ffc8803 ExampleResourceRequestHandler - Add a brief xml doc to the class 2019-09-29 14:28:32 +10:00
amaitland 0d236b3b45 Example - Update ResponseFilter example to reflect NetworkService changes
- MemoryStreamResponseFilter renamed to StreamResponseFilter
- Stream is now passed into StreamResponseFilter constructor
- ExampleResourceRequestHandler updated to reflect that it now represents a single resource request
- ExampleResourceRequestHandler is now used for all requests from the CefSharpSchemeHandlerFactory.SchemeName custom scheme

Issue #2743
2019-09-29 14:19:25 +10:00
amaitland 3199872247 JSB - Pass params to IMethodInterceptor.Intercept
Breaking change

Resolves #2909
2019-09-27 08:17:43 +10:00
amaitland e438e22741 Example - Add JSB Qunit Tests for Binder UInt conversion
Issue #2906
2019-09-27 08:07:37 +10:00
amaitland 6da0e9ca74 Example - Demo loading Png
https://cefsharp.example/logo.png
2019-09-20 20:38:06 +10:00
amaitland f088a7c169 CefSettings - Add custom dictionary to allow setting of command line args with no value
- Updated CefExample to remove "1" values from the command line arg examples

Issue #2858
2019-09-06 13:05:50 +10:00
amaitland 52ec00c486 Code cleanup - Rename IWebBrowser browserControl to chromiumWebBrowser
Hopefully this makes it clearer that the IWebBrowser instance is actually the ChromiumWebBrowser

Updated almost all instances, there's one WinForms example that wasn't updated
2019-07-20 16:26:25 +10:00
amaitland 209bde2c04 BindingTest.html - Reformat using editorconfig 2019-07-20 12:28:51 +10:00
Angshuman Agarwal 48eaff87dc Javascript Integration - Passing empty array in JS now maps to empty list/array instead of null (#2829)
* Set empty list instead of null

* Added QUnit Test for testing Empty Array
2019-07-20 12:17:44 +10:00
amaitland 750fc9f22e Javascript Binding - Add support for JsonString
JsonString is parsed into CefValue using the CefParseJson function
If your data is already stored in JSON then it can be parsed directly
or you can use a serializer of your choosing to turn a object into JSON
2019-07-20 12:11:43 +10:00
amaitland 256e7275d5 IRequestHandler.GetAuthCredentials - Replace frame param with sourceUrl
https://bitbucket.org/chromiumembedded/cef/commits/5e9ca096e0bbdbd6661df5d882082e3324237993
2019-07-18 21:18:56 +10:00
amaitland cdca99c548 CefExample - Remove disable-direct-write
No longer supported by Chromium.
2019-07-18 19:59:47 +10:00
amaitland 4183b464d1 WPF/WinForms Example - Allow mailto to trigger OnProtocolExecution
- When Url starts with mailto then use our ExampleResourceRequestHandler
- Ignore unknown scheme errors when it's mailto, we expect that it's unknown
- WPF Example remove duplicate OnLoadError in BrowserTabViewModel
2019-07-10 20:47:55 +10:00
amaitland 3bb2175919 CefExample - Disable LegacyBindingEnabled
Accidentally enabled it previously
2019-07-08 08:33:39 +10:00