Commit Graph

253 Commits

Author SHA1 Message Date
Alex Maitland 8df478afc9 Add Fluent DownloadHandler (#3576)
* Core - Add Fluent DownloadHandler implementation and IFrame.DownloadUrlAsync

Resolves #3550
2021-06-01 13:35:15 +10:00
Alex Maitland 5c447266a6 Upgrade to CEF 90.6.7+g19ba721+chromium-90.0.4430.212 / Chromium 90.0.4430.212 2021-05-29 12:01:44 +10:00
Alex Maitland 7989023bd3 Test - Add OffScreen CanLoadMultipleBrowserInstancesSequentially
Create/Dispose of 1000 OffScreen ChromiumWebBrowser instances

Issue #3552
2021-05-14 13:54:47 +10:00
Alex Maitland f8433de4e4 Test - CachePath should be child of RootCachePath 2021-05-12 10:59:18 +10:00
Alex Maitland 4a0fb32edd Upgrade to CEF 90.6.5+g7a604aa+chromium-90.0.4430.93 / Chromium 90.0.4430.93 2021-05-08 14:01:51 +10:00
Alex Maitland f6a347abf6 Javascript Binding - CefSharp.BindObjectAsync() never raised the ResolveObject event
Resolves #3470
2021-04-28 13:45:58 +10:00
Alex Maitland c630d77ef3 Test - Add Test to verify workaround for issue #3470 2021-04-28 13:36:50 +10:00
Alex Maitland 854f81e8ed Upgrade to CEF 90.5.7+gcd9342c+chromium-90.0.4430.85 / Chromium 90.0.4430.85 2021-04-24 20:05:30 +10:00
Alex Maitland 70282dd2c1 Upgrade to CEF 90.5.3+gaf0e862+chromium-90.0.4430.72 / Chromium 90.0.4430.72 2021-04-23 16:59:59 +10:00
Alex Maitland 22ef1bdc39 Core - Add IRequestContext.SetProxyAsync
Can be called on any Thread to change the proxy at runtime
2021-04-23 16:36:10 +10:00
campersau fb54f103c4 DevTools Client - Serialize lists of DevToolsDomainEntityBase (#3487) 2021-04-23 16:35:55 +10:00
Alex Maitland 6fa25ab9db Test - Improve reliability of JavaScriptObjectRepositoryFacts.CanRegisterJavascriptObjectBindWhenNamespaceIsNull
- JavascriptObjectRepository generates object ids using a static counter, we need to get the object Id for this
  test to be reliable, using an Object Id of 1 will fail if the test order isn't in a very specific order
2021-04-05 13:38:02 +10:00
Alex Maitland 1599bfa9cd Javascript Binding - Fix failing .Net Core Test case
- Add condition to calling Register()
- Add license disclaimer

Follow up to #3467
2021-04-05 10:54:22 +10:00
pedoc 1ff25441ea Javascript Binding - Allow binding to classes in the global namespace (#3467)
* fix IsComplexType NullReferenceException

Sometimes, the registered Javascript object does not have a namespace, at this time this function will throw a ```NullReferenceException```.

* add unit test for IsComplexType

* Simplify and remove useless code

* Update CefSharp/Internals/JavascriptObjectRepository.cs

Co-authored-by: campersau <buchholz.bastian@googlemail.com>

Co-authored-by: Alex Maitland <amaitland@users.noreply.github.com>
Co-authored-by: campersau <buchholz.bastian@googlemail.com>
2021-04-05 10:31:15 +10:00
Alex Maitland 6efd867720 Upgrade to CEF 89.0.17+ge7bbb1d+chromium-89.0.4389.114 / Chromium 89.0.4389.114 2021-04-05 10:06:41 +10:00
Alex Maitland fc2ce2608d Upgrade to CEF 89.0.14+gb1b52fe+chromium-89.0.4389.90 / Chromium 89.0.4389.90 2021-03-25 10:40:22 +10:00
Alex Maitland f1635de045 Upgrade to CEF 89.0.12+g2b76680+chromium-89.0.4389.90 / Chromium 89.0.4389.90 2021-03-22 14:42:09 +10:00
Alex Maitland 6b27ba8d2b Test - Fix a couple of javascript warnings 2021-03-16 15:31:13 +10:00
Alex Maitland df68bd0432 Upgrade to CEF 89.0.7+gb5952bd+chromium-89.0.4389.72 / Chromium 89.0.4389.72 2021-03-16 15:31:12 +10:00
Alex Maitland bbf5d5ed0f Upgrade to CEF 89.0.6+g6f30454+chromium-89.0.4389.72 / Chromium 89.0.4389.72 2021-03-06 13:04:02 +10:00
Alex Maitland 48480feb6d Upgrade to CEF 88.2.9+g5c8711a+chromium-88.0.4324.182 / Chromium 88.0.4324.182 2021-02-21 20:03:02 +10:00
Alex Maitland c5669068cc Upgrade to CEF 88.2.4+gf3c4ca9+chromium-88.0.4324.150 / Chromium 88.0.4324.150 2021-02-09 09:48:12 +10:00
Alex Maitland 1661b2f955 Upgrade to CEF 88.2.1+g0b18d0b+chromium-88.0.4324.146 / Chromium 88.0.4324.146 2021-02-05 15:00:16 +10:00
Alex Maitland a4fdda6945 Update to CEF 88.1.6+g4fe33a1+chromium-88.0.4324.96 / Chromium 88.0.4324.96 2021-02-03 15:53:00 +10:00
Alex Maitland 0ebdc456b4 Test - Add CanLoadRequestWithPostData test 2021-01-15 13:39:34 +10:00
Alex Maitland 2b4a8cb18e Core - PublicApi remove references to CefSharp.Core.Runtime
- Add an UnWrap method to the interfaces (should be hidden from IntelliSense)
- For .Net 4.5.2 projects they're  not a decorator class which an inner instance of the CefSharp.Core.Runtime Type
- For Net Core we have a ref assembly which allows us to reference the CefSharp.Core.Runtime without issues
  We can potentially remove the ref assembly now and forgo any direct reference.
2021-01-13 16:51:30 +10:00
Alex Maitland 66c95bc499 WinForms/WPF - Fix BrowserSettings/RequestContext type checking
- When settings BrowserSettings/RequestContext properties the type checking needs to make sure the
CefSharp.Core.BrowserSettings and CefSharp.BrowserSettings objects are acceptable
- In WPF only the RequestContext was updated as there's no check for BrowserSettings property yet (probably should be)

https://github.com/cefsharp/CefSharp/issues/3343#issuecomment-757581368
2021-01-11 20:32:22 +10:00
Alex Maitland ff77f024ad Upgrade to CEF 87.1.13+g481a82a+chromium-87.0.4280.141 / Chromium 87.0.4280.141 2021-01-09 13:52:28 +10:00
Alex Maitland 848413bb2c DevTools Client - Make Message Id globally unique
When attempting to use two DevTools Client instances the message Id
fails validation as it's not incrementing per CefBrowser instance.

This should be made unique per CefBrowser

Issue #3341 has been created to document improving this.
2021-01-08 17:03:24 +10:00
Alex Maitland dcf5b43dc4 Core - Add Net Core DevTools
- Add specific Net Core DevTools generated code
- Improve xml doc generation for both Net 4.x and Net Core/Net 5
2021-01-08 14:26:21 +10:00
Alex Maitland 8a367fbdc4 Refactor CefSharp.Core into CefSharp.Core.Runtime (#3311)
* Net Core - Rename CefSharp.Core.dll to CefSharp.Core.Runtime.dll

Partial rename, only Net Core, folder not renamed

* Net Core - Rename CefSharp.Core.RefAssembly to CefSharp.Core.netcore

Remove GenApi

* Core - Rename CefDragDataWrapper to DragData

Move into CefSharp.Core namespace

* WinForms/WPF/OffScreen - Migrate from GitLink command line to Nuget package

* Net Core - Refactor to have CefSharp.Core.dll contain only public Api

* Net Core - Remove CefSharp.Core.RefAssembly

* Net Core - Change CefSharp.Core.netcore output folder

* Net Core - Restructure nuget packages

* Net Core - Add Cefsharp.Core.Runtime.RefAssembly

* Net Core - Hide CLI/C++ classes from intellisense

Make sure users don't attempt to load them directly

* Rename CefSharp.Core to CefSharp.Core.Runtime

* Core - Restructure Net 4.5.2 packages to use CefSharp.Core.dll anycpu variant

Attempt to load CefSharp.Core.Runtime at runtime rather than having to use msbuild to copy the correct version

* Rename CefSharp.Core.netcore to CefSharp.Core

* WPF/WinForms/OffScreen - Change from x86/64 to AnyCPU

As they are all managed assemblies they can target AnyCPU.
Includes CefSharp.dll

* Convert RequestContextBuilder from C++ to C#

Now part of the CefSharp.Core PublicApi

* Update version number to 87.1.11

* Migrate more of the public Api to C#

* Net Core - Basic restructure complete

* Net Core - ModuleInitializer (Doesn't work yet)

* Remove direct references to BrowserSettings

* Net Core - ModuleInitializer load CefShar.Core.Runtime.dl

* Net Core - Load libcef.dll via CLR Module initializer

If no RID is specified then we can load libcef.dll using the module initializer

* Add version to CefSharp.Core

* Remove dependency on CefSharp.Core.Runtime
Rewrite common targets

* AnyCPU app.config transform

Improve AnyCPU support

* Improve Net Core 3 support
Only delete CefSharp.Core.Runtime.dll when AnyCPU

* Nuget - Add CefSharp.Core.Runtime reference when TargetFramework = NetCore

* Fix Typos

Based on #3306

* Net Core - Rename CefSharp.Core.Runtime RefAssembly source file

* Net Full - Generate CefSharp.Core.Runtime Ref Assembly

For now the powershell build script generates the .cs file based on a x86 release build.ps1
It's not possible to directly install GenApi as it requires a Sdk style project

* Net Core - Old packages copy files to required folders

* Test - Install newer .Net Compiler and set Lang Version to 7.3

* Net Core - Exclude Net 452 Runtime generated reference source

* Core - Add Refactoring TODO

* Ref Assembly - Generate source as part of build

- Move ref assembly source generate into GenerateRefAssemblySource.ps1
- Call before project build

Runs locally, see if Appveyor has a problem with the powershell script execution

* Core - Add more factory methods to create instances of managed wrappers

* Net Core - Make Initialzier properties internal

Not quite sure what the public API should look like as yet, so making internal for now.
2020-12-16 10:47:34 +10:00
pgodwin b8a36411ce Add async to EvaluateScriptAsPromiseAsync and tests (#3314)
Co-authored-by: Peter Godwin <peter.godwin@health.qld.gov.au>
2020-12-11 13:01:27 +10:00
Alex Maitland 6daf660caf Upgrade to 87.1.12+g03f9336+chromium-87.0.4280.88 / Chromium 87.0.4280.88 2020-12-11 11:19:02 +10:00
Alex Maitland a84d6e0958 Upgrade to CEF 87.1.11+g8bb7705+chromium-87.0.4280.66 / Chromium 87.0.4280.66 2020-11-29 17:58:59 +10:00
amaitland 55af252d91 Core - Refactor JavascriptObjectRepository to IJavascriptObjectRepositoryInternal
Basic refactoring in preparation for allowing users(advanced) to provide their own custom JavascriptObjectRepository implementation
2020-11-25 15:23:29 +10:00
Alex Maitland 2aa3ed13e5 Upgrade to CEF 87.1.6+g315d248+chromium-87.0.4280.66 / Chromium 87.0.4280.66 2020-11-24 10:29:35 +10:00
Alex Maitland e213f37285 Core - EvaluateScriptAsPromiseAsync not working when JavascriptBindingApiGlobalObjectName specified
Resolves #3281
2020-11-14 12:07:38 +10:00
campersau e873f8fe60 Test - Add CefSharp.RenderProcessId javascript binding test
Issue #2984
2020-11-09 20:53:35 +10:00
Alex Maitland 74326a62ec Upgrade to CEF 87.1.1+g9a70877+chromium-87.0.4280.27 / Chromium 87.0.4280.27 2020-11-07 16:00:58 +10:00
amaitland bf504a2641 Upgrade to 86.0.20+gf2039ae+chromium-86.0.4240.111 / Chromium 86.0.4240.111 2020-10-31 19:22:45 +10:00
amaitland c8fc8810dd Upgrade to CEF 86.0.19+g9c5fca5+chromium-86.0.4240.111 / Chromium 86.0.4240.111 2020-10-30 15:55:25 +10:00
amaitland 166c57addb Upgrade to CEF 86.0.17+g4a33048+chromium-86.0.4240.75 / Chromium 86.0.4240.75 2020-10-21 15:56:23 +10:00
amaitland 841156c8ee Test - Add CanEvaluateScriptAsPromiseAsyncReturnObject
Promise return complex object

Issue #3251
2020-10-20 07:18:28 +10:00
amaitland 2d3be70609 Test - Add expiry to DevToolsClientFacts.CanSetCookieForDomain test
#3218
2020-10-16 19:58:30 +10:00
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
Alex Maitland fd46a4c145 Core - Add EvaluateScriptAsPromiseAsync (#3251)
- Add useImmediatelyInvokedFuncExpression param to EvaluateScriptAsync which wraps the script in an IIFE
  with the cefSharpInternalCallbackId variable defined in scope to allow for deferred completion
- Wrap script in Immediately Invoked Function Expression and call promise.resolve to guarantee a promise.
- Return 'CefSharpDefEvalScriptRes' as the result of the js function to defer execution of the callback
- Call newly added cefSharp.sendEvalScriptResponse method in javascript when promise has been resolved/rejected

This is built up of a few parts and can technically be used by the new user to defer the response until they are ready.
Just return `'CefSharpDefEvalScriptRes'` and manually call cefSharp.sendEvalScriptResponse using the cefSharpInternalCallbackId
variable which is injected into the script execution (wrapped in an IIFE to limit scope)
2020-10-06 15:19:37 +10:00
amaitland 02a8ea70cd Upgrade to CEF 85.3.12+g3e94ebf+chromium-85.0.4183.121 / Chromium 85.0.4183.121 2020-10-04 14:45:58 +10:00
amaitland b4c2e359a6 Core - Improve IRequestContext.SetProxy extension Method
- Add tests
- Add better validation

Issue #3235
2020-10-02 17:13:49 +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 05665405f4 Core - Legacy Javascript Binding Integration Test
Add integration test (only in Net Full, not Net Core currently)

#2977
2020-09-16 19:58:40 +10:00