Commit Graph

218 Commits

Author SHA1 Message Date
Alex Maitland 01cfa69121 Upgrade to CEF 86.0.24+g85e79d4+chromium-86.0.4240.198 / Chromium 86.0.4240.198 2020-11-20 10:30:37 +10:00
Alex Maitland 3c023fe7b4 Upgrade to CEF 86.0.23+ga2c2edf+chromium-86.0.4240.193 / Chromium 86.0.4240.193 2020-11-18 10:50:06 +10:00
Alex Maitland e9bbcd6bdd Core - EvaluateScriptAsPromiseAsync not working when JavascriptBindingApiGlobalObjectName specified
Resolves #3281
2020-11-14 12:09:47 +10:00
Alex Maitland b7ad18c598 Upgrade to CEF 86.0.21+g6a2c8e7+chromium-86.0.4240.183 / Chromium 86.0.4240.183 2020-11-07 18:26:33 +10:00
amaitland c802cbf0f4 Upgrade to CEF 86.0.19+g9c5fca5+chromium-86.0.4240.111 / Chromium 86.0.4240.111 2020-10-30 16:03:13 +10:00
amaitland 7b11952323 Upgrade to CEF 86.0.17+g4a33048+chromium-86.0.4240.75 / Chromium 86.0.4240.75 2020-10-28 16:07:22 +10:00
amaitland e8d0a17621 Upgrade to 85.3.13+gcd6cbe0+chromium-85.0.4183.121 / Chromium 85.0.4183.121
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15999
- https://bitbucket.org/chromiumembedded/cef/commits/cd6cbe008b127990036945fb75e7c2c1594ab10d
2020-10-25 11:59:13 +10:00
amaitland dadb4fa707 Test - Add CanEvaluateScriptAsPromiseAsyncReturnObject
Promise return complex object

Issue #3251
2020-10-20 07:19:19 +10:00
amaitland fe4c0b66a2 Test - Add expiry to DevToolsClientFacts.CanSetCookieForDomain test
#3218
2020-10-16 19:57:43 +10:00
Alex Maitland 0a8e7d2b6c 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:42:21 +10:00
Alex Maitland deca49517b 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:20:50 +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
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 1e141d0479 Upgrade to CEF 84.4.1+gfdc7504+chromium-84.0.4147.105 / Chromium 84.0.4147.105 2020-08-26 13:50:41 +10:00
amaitland 74c23b1dfe Test - Revert c# Discard
Older compiler doesn't like it

Will look at rewriting test later
2020-08-18 19:20:44 +10:00
amaitland f11785e44b Core - Fix some compiler warnings 2020-08-18 18:08:09 +10:00
amaitland d76379f7e9 Upgrade to CEF 84.4.0+g304e015+chromium-84.0.4147.105 / Chromium 84.0.4147.1055 2020-08-14 16:14:09 +10:00
amaitland 2a96ebc7de Upgrade to CEF 84.3.8+gc8a556f+chromium-84.0.4147.105 / Chromium 84.0.4147.105 2020-08-05 15:48:47 +10:00
Alex Maitland b5a83f526e Enhancement - Pluggable Javascript Naming (#3141)
* Core - Move NameConverter to IJavascriptObjectRepository

- Move NameConverter property from BindingOptions to IJavascriptObjectRepository
- Remove BindingOptions.CamelCaseJavascriptNames

**Breaking Change**

Follow up to https://github.com/cefsharp/CefSharp/commit/898ca38e7a7261b3a42c33b2abf5eac6c022ddde

* Core - Javascript Binding Pluggable Naming Improvements

- Added some basic unit tests (more required)
- DefaultBinder now accepts a IJavascriptNameConverter passed into the constructor
  to allow for conversion of names

* Core - Replace WeakReference with WeakReference<T>
2020-07-27 20:13:16 +10:00
amaitland 1af1065f03 Net Core - Add XUnit Test Project
Issue #3197
2020-07-24 21:07:29 +10:00
amaitland 3e5133dbb3 Upgrade to CEF 84.3.3+gffc2f0e+chromium-84.0.4147.89 / Chromium 84.0.4147.89 2020-07-23 14:56:10 +10:00
campersau 760cc13d96 Remove unused JavascriptBindingFacts tests (#3194) 2020-07-23 14:17:41 +10:00
campersau 1e3b1c6305 add test for binding object multiple times (#3195)
see 4b2fe1e0d7
2020-07-23 05:31:05 +10:00
amaitland 36b35e478b Upgrade to CEF 83.4.2+gc8d4f85+chromium-83.0.4103.106 2020-07-02 09:46:41 +10:00
amaitland 0bf05e6de7 Upgrade to CEF 83.4.0+gfd6631b+chromium-83.0.4103.106 / Chromium 83.0.4103.106 2020-06-28 20:08:18 +10:00
amaitland c1a4db20fd Upgrade to CEF 83.3.12+g0889ff0+chromium-83.0.4103.97 / Chromium 83.0.4103.97 2020-06-09 15:57:25 +10:00
amaitland 3ba91f5798 Test - OffScreenBrowserBasicFacts remove assert
It's possible that BrowserRefCounter.Instance.Count is 0 after
we Dispose, so we'll update our test to make sure we have at most
one instance, and it's fine we if have 0
2020-05-30 19:28:51 +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 c0ba9e9135 Upgrade to CEF 83.3.9+ged43e55+chromium-83.0.4103.61 / Chromium 83.0.4103.61 2020-05-25 20:04:27 +10:00
amaitland b86a3ac59a Tests - Add OffScreenBrowserBasicFacts.CanExecuteJavascriptInMainFrameAfterNavigatingToDifferentOrigin
Confirm CanExecuteJavascriptInMainFrame is true after navigating to a different origin

Resolves #3021
2020-05-19 08:23:47 +10:00
amaitland 940034314b Tests - Convert BinderFacts.NullToValueType to NullToValueTypeTheory
Now uses Theory with InlineData
2020-05-18 11:47:43 +10:00
amaitland 99cc2d5030 Core - Cef.GetMimeType custom/fallback mimeType mapping
- return application/octet-stream when no mapping found
- Add custom dictionary with some additional mimeTypes, users can add their own to this dictionary
- Add xunit test

Resolves #3041
2020-05-18 11:47:42 +10:00
amaitland ef590444b4 Core - DefaultBinder InvalidOperationException when binding [1,2,3,1.23] to double[]
- Bind for all elements in a collection, not just when the collection contains list/arrays
- Add additional unit tests

JavaScript array of [1,2,3,1.23] translates to [int, int, int, double], when attempting to Bind
to a double[] an InvalidOperationException was thrown. We now call Bind for each element,
when the type is directly assignable we return the value, for cases like above we perform a
type conversion.

Resolves #3129
2020-05-18 09:13:02 +10:00
amaitland b9fba00078 Upgrade to CEF 81.3.10+gb223419+chromium-81.0.4044.138 2020-05-15 20:26:43 +10:00
amaitland 0f3de6f432 Upgrade to CEF 81.3.2+gb9282cc+chromium-81.0.4044.138 / Chromium 81.0.4044.138 2020-05-09 05:54:38 +10:00
amaitland 6b440a84a3 Shutdown - Improve WaitForBrowsersToClose
- Add Cef.PreShutdown
- For WPF hook the DispatcherShutdownStarted and DispatcherShutdownFinished events then call Cef.PreShutdown
- Add NoOpBrowserRefCounter and set as default, needs a little more testing before it's enabled by default.
  Can be enabled by calling Cef.EnableWaitForBrowsersToClose before calling Cef.Initialize

Issue #3047
2020-05-03 21:58:05 +10:00
amaitland 98b7abeeea Core - PathCheck rewrite to match Chromium FilePath::IsAbsolute
Resovles #3102
2020-05-03 19:28:32 +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 2602212f79 Upgrade to CEF 81.3.1+gb2b49f1+chromium-81.0.4044.113 / Chromium 81.0.4044.113 2020-05-03 14:01:48 +10:00
amaitland 3bac04d1d0 Upgrade to CEF 81.2.25+g3afea62+chromium-81.0.4044.113 2020-04-29 07:57:02 +10:00
amaitland f566d99b12 Upgrade to CEF 81.2.21+ge864886+chromium-81.0.4044.113 / Chromium 81.0.4044.113 2020-04-23 05:56:17 +10:00
amaitland 51fef05989 Upgrade to CEF 81.2.17+gb382c62+chromium-81.0.4044.113 / Chromium 81.0.4044.113 2020-04-18 10:52:53 +10:00
amaitland b2dc7bfc0d Upgrade to CEF 80.1.15+g7b802c9+chromium-80.0.3987.163 / Chromium 80.0.3987.163 2020-04-05 07:56:02 +10:00
amaitland 3d3c1c203c Upgrade to CEF 80.1.4+g8927396+chromium-80.0.3987.149 / Chromium 80.0.3987.149 2020-04-03 09:58:37 +10:00
amaitland ce94992d28 Tests - Skip ConcurrentMethodRunnerQueueFacts.ValidateAsyncTaskMethodOutput
It's unreliable, will improve as part of https://github.com/cefsharp/CefSharp/issues/3067
2020-04-01 12:34:25 +10:00
amaitland 509c0dfcb5 Upgrade to CEF 80.1.2+g9d2a31e+chromium-80.0.3987.149 / Chromium 80.0.3987.149 2020-03-31 07:14:53 +10:00
amaitland 4d47b749b1 Test - Avoid displaying Form in WinForms Test
Call CreateControl instead of displaying form.

Tooltips, context menus may not be positioned/displayed correctly as there is no parent form (window). For testing
purposes that's fine for now.
2020-03-03 07:01:00 +10:00