Commit Graph

2231 Commits

Author SHA1 Message Date
amaitland e4312760ce API Change - IJavascriptObjectRepository.Register remove isAsync default param
**BREAKING CHANGE**

- You must now explicitly specify the `isAsync` param.
- Add additional xml doc comment regarding .Net Core and using only isAsync = true

The isAsync = false option (sync binding) requires WCF which isn't available on .Net core, remove the default value so you are forced to specify an option and in the process hopefully read the documentation.

For those who previously hadn't provided a param then simply pass in false for the third argument.
e.g.
browser.JavascriptObjectRepository.Register("bound", new BoundObject(), false);

Resolves #3016
2020-01-21 08:39:23 +10:00
amaitland 19a70727f2 WinForms/WPF/OffScreen - Improve Dispose/BrowserInitialized error messaging
- Set CanExecuteJavascriptInMainFrame to false when disposing
- Throw exception if Disposed when calling GetBrowser method
- Improve error messaging
2020-01-15 11:16:06 +10:00
amaitland 00f8cdf59b Core - ResourceHandler add Charset optional param to constructor or FromStream 2019-12-13 18:59:20 +10:00
amaitland 002f023b39 Core - Add Legacy ResourceHandler
Supports the old CEF code path
2019-12-13 18:54:05 +10:00
amaitland 453f8d2077 Core - ResourceHandler now reuses it's temp byte[] buffer 2019-12-11 18:21:19 +10:00
amaitland c5c9271cb7 Core - WebBrowserExtensions.RegisterJsObject and WebBrowserExtensions.RegisterAsyncJsObject now throw NotImplementedException
Follow up to commit ffaff5d151.

Resolves #2990
2019-12-11 14:12:31 +10:00
amaitland ffaff5d151 Core - Remove WebBrowserExtensions.RegisterJsObject and WebBrowserExtensions.RegisterAsyncJsObject
This is a breaking change, these methods are being removed as they are used for LegacyBinding which is being drastically changed in #2977

Resolves #2990
2019-12-11 10:08:08 +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 99c177aa30 IBrowserHost.GetVisibleNavigationEntry - Add call to ThrowIfExecutedOnNonCefUiThread guard and improve xml doc
Resolves #2986
2019-12-10 08:08:19 +10:00
amaitland db4f5f3822 Core - Fix WebBrowserExtensions xml doc 2019-12-10 07:54:28 +10:00
amaitland 30950e5bd1 Core - Cef.GetGlobalCookieManager add ICompletionCallback overload
- Callback is executed after the store is ready.
- CookieManagerDecorator added (not yet used), will look at providing the user with clearer feedback
  that the store isn't ready, quite often people attempt to get/set cookies when the manager just isn't ready

TODO: Add tests for CookieManagerDecorator and add an overload that uses it
2019-12-02 20:03:59 +10:00
amaitland f9c9c7fce5 Core - RequestContext.ClearHttpAuthCredentials now defaults to using NoOpCompletionCallback if callback was null
Workaround for a CEF bug which crashes if NULL is passed in as arg to CefRequestContext::ClearHttpAuthCredentials

https://github.com/cefsharp/CefSharp/issues/2957#issuecomment-555285400
2019-11-27 11:23:07 +10:00
amaitland 6af44d7777 Core - Add IRequest.PostData setter
can be used with the new PostData public class

request.PostData = new PostData();
2019-11-23 15:21:18 +10:00
amaitland 47e2d211a8 Add RequestContext.ClearHttpAuthCredentialsAsync extension method
- Add ClearHttpAuthCredentialsAsync extension
- Make IRequestContext.ClearHttpAuthCredentials callback param default to null

NOTE: Calling IRequestContext.ClearHttpAuthCredentials without a callback is crashing, appears to be a bug in CEF.

Issue #2957
2019-11-19 11:10:11 +10:00
Nick 876d3f9ecf Add IRequestContext.ClearHttpAuthCredentials (#2959)
Add IRequestContext.ClearHttpAuthCredentials
2019-11-18 13:13:30 +11:00
João Neves e81a3ed316 Fixed crash accessing js objects dictionary concurrently 2019-11-03 12:50:02 +10:00
amaitland 60a1f640cf CEF Upgrade - Breaking Changes
- Remove CefSettings.EnableNetSecurityExpiration
- Remove RequestContextSettings.EnableNetSecurityExpiration
#2954

- Remove IFrame.LoadStringForUrl and IWebBrowser.LoadString
Resolves #2955
2019-11-03 12:33:45 +10:00
amaitland a8d5b85ed3 Request/Response Headers - Fix incorrect handling of readonly
- Rename ReadOnlyNameValueCollection to HeaderNameValueCollection
- Set ReadOnly after the collection has been populated.

Resolves #2946
2019-10-29 19:36:01 +10:00
amaitland 0979a4de2a IFrame.LoadRequest - Add xml doc warning
WARNING: This method will fail with "bad IPC message" reason
INVALID_INITIATOR_ORIGIN (213) unless you first navigate to the
request origin using some other mechanism (LoadURL, link click, etc).

Resolves #2932
2019-10-28 12:08:28 +10:00
amaitland b0eeca3107 xml doc - Fix mistakes 2019-10-07 19:46:45 +10:00
amaitland e902f4ad73 DefaultBinder - Fix bug introduced by refactoring
https://github.com/cefsharp/CefSharp/commit/8d5556e3689278b91e54099f349b3779c2c809f2
2019-10-05 13:51:23 +10:00
amaitland 8d5556e368 DefaultBinder - Performance Improvements and code simplification
- Major refactor, greatly simplified code
- Performance improvements

Breaking changes
2019-10-04 17:46:33 +10:00
amaitland 396e2cb5b8 ModelBinding - Major refactor
- Remove unused IFieldNameConverter/DefaultFieldNameConverter
- DefaultBinder remove blacklistnames
2019-10-04 14:41:45 +10:00
Alex Maitland cc2359126b BrowserSubprocess - Refactor to support .Net Core (#2891)
* BrowserSubprocess - Refactor to support .Net Core

- Added BrowserSubprocessExecutable for use with .Net Core (no WCF)
- Added WcfBrowserSubprocessExecutable for use with the existing CefSharp.BrowserSubprocess.exe which supports WCF (conditionally)

* Add additional comments and minor code simplification
2019-10-02 12:25:34 +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 3199872247 JSB - Pass params to IMethodInterceptor.Intercept
Breaking change

Resolves #2909
2019-09-27 08:17:43 +10:00
amaitland 294c0b2f63 IBinder/DefaultBinder - Rename modelType to targetParamType
Hopefully param names makes the intent clearer
2019-09-27 08:00:25 +10:00
amaitland 8717167b76 JavascriptObjectRepository - Pass all params into IBinder.Bind not just dictionary/list
Previously only IDictionary<string, object>, IList<object> were passed, now all params are passed to allow for type conversion (Issue #2906)

Binding now occurs before missing params are added (they weren't passed to the binder previously, so this doesn't change the behaviour

This is a breaking change.

Resolves #2908
2019-09-27 08:00: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 25ab209380 MethodRunnerQueue/ConcurrentMethodRunnerQueue - Remove custom task execution queue
- ConcurrentMethodRunnerQueue we now directly queue tasks on TaskScheduler.Default
- MethodRunnerQueue now uses LimitedConcurrencyLevelTaskScheduler (example from Microsoft) to limit execution to one concurrent task
- MethodRunnerQueue tasks are now run on the ThreadPool directly instead of our own custom thread, should have some threading implications
for user
- IMethodRunnerQueue now implements IDisposable

Resolves #2873
2019-09-06 11:05:18 +10:00
amaitland f88708f063 WebBrowserExtensions - Make GetScript public and rename to GetScriptForJavascriptMethodWithArgs 2019-09-06 09:59:31 +10:00
amaitland b35d5151fe IRequest/IResponse - Improve IsReadOnly handling
- Throw exception if attempting to set property on readonly request/response
- return ReadOnlyNameValueCollection if Headers are readonly
2019-09-05 19:55:32 +10:00
amaitland 794c77e79d IBrowserHost - Add GetZoomLevel
Can be called directly on the CEF UI thread
2019-09-02 11:39:21 +10:00
amaitland 88ab0a1a69 Update version numbers to 76.1.90 2019-08-14 10:14:18 +10:00
amaitland b5993fb31e ICookieManager - Update xml doc
Updated to reflect upstream changes see https://magpcss.org/ceforum/apidocs3/projects/(default)/CefCookieManager.html

Resolves #2855
2019-08-14 07:44:03 +10:00
amaitland f3e400d8d7 Update version number to 76.1.50 2019-08-02 10:14:31 +10:00
amaitland 47b488061e ISelectClientCertificateCallback - Update xml doc, return null means no certificate selected.
Update WinForms Example to deal with user cancellation of certificate selection UI

Resolves #2853
2019-07-31 19:41:08 +10:00
amaitland 010c5aea74 Scheme Registration - Only register custom scheme name one
Adding multiple entries to CefSettings.RegisterScheme that share the same scheme name
yet have different domain/schemehandlerfactory implementations is valid.

We will only register the first set of SchemeName/SchemeOption values (first call to RegisterScheme).
2019-07-30 20:58:57 +10:00
amaitland 6cc1026156 Upgrade version to 75.1.140 2019-07-27 21:36:33 +10:00
amaitland 75fc1737cd Rect - Change to use Math.Ceiling as that appears to match what CEF uses
cefclient uses Math.Floor though when I examine the values returned they're always one less
use use Math.Ceiling appears to match
2019-07-27 19:31:46 +10:00
amaitland ee30c90228 WPF - GetScreenInfo scale Rect/AvailableRect
Scale by DpiScaleFactor
2019-07-27 19:31:45 +10:00
amaitland 119e29e5e3 Rect - Add DebuggerDisplay 2019-07-27 19:31:45 +10:00
amaitland 581fa04ef7 ICookieManager - Update xml doc (methods are executed on UI thread now) 2019-07-23 20:45:24 +10:00
amaitland e36620ed54 JsonString - Revert to older throw style syntax
VS2015 C# compiler doesn't like it and we still haven't installed the newer compiler Nuget packages
2019-07-20 16:34:33 +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 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 6233925efd Upgrade version number to 75.1.40 2019-07-18 21:23:41 +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