1931 Commits

Author SHA1 Message Date
amaitland eee5a35b78 Core - Fix Broken Build
- DefaultRequestHandler now implements OnDocumentAvailableInMainFrame
- Removed non existent files from project
2020-07-02 10:31:06 +10:00
amaitland c9fedb28d1 Upgrade to CEF 83.4.2+gc8d4f85+chromium-83.0.4103.106 2020-07-02 10:03:31 +10:00
amaitland cc31e2b149 Core - Add ExecuteDevToolsMethodAsync extension method
ExecuteDevToolsMethod has to be called exclusively on the CEF UI thread.
This extension method will invoke into the CEF UI thread if required.
2020-07-02 10:03:28 +10:00
amaitland e12bd023f1 Core - Add support for direct DevTools protocol messaging
Add support for direct DevTools protocol messaging (fixes issue #2961).

This change allows the client to directly send and receive DevTools
protocol messages (send method calls, and receive method results and
events) without requiring a DevTools front-end or remote-debugging
session.

https://bitbucket.org/chromiumembedded/cef/commits/fd6631bd181233d36b98e1327da84c44372add76
2020-07-02 10:03:26 +10:00
amaitland 05712c38e7 Core - Add IRequestHandler.OnDocumentAvailableInMainFrame
Resolves #3157
2020-07-02 10:03:25 +10:00
amaitland a2fc01c4e3 Upgrade to CEF 83.4.0+gfd6631b+chromium-83.0.4103.106 / Chromium 83.0.4103.106 2020-07-02 10:03:24 +10:00
amaitland e290d5ab23 Core - ByteArrayResourceHandler throw exception if byte[] length 0
We cannot create a CefStreamReader when buffer length is 0
CefStreamReader::CreateForData returns null and CefStreamResourceHandler crashes
as the stream is null

https://github.com/chromiumembedded/cef/blob/9df4a54308a88fd80c5774d91c62da35afb5fd1b/libcef/browser/stream_impl.cc#L27
https://github.com/chromiumembedded/cef/blob/a94dc6a0588e15deb184650b9015cd259e52a702/libcef_dll/wrapper/cef_stream_resource_handler.cc#L79
2020-06-09 15:58:19 +10:00
amaitland 37a5193441 Core - ResourceHandler default Access-Control-Allow-Origin to * 2020-06-09 15:58:19 +10:00
amaitland 631814f9e5 Core - Improve CefSharpSettings.ConcurrentTaskExecution xml doc 2020-06-09 15:58:18 +10:00
amaitland b2e0e04d58 Update version number to 81.3.100 2020-05-23 10:17:08 +10:00
amaitland d1b4492549 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:40:38 +10:00
amaitland 8803f1c041 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:12:11 +10:00
amaitland 99dd3f4273 Upgrade version number to 81.3.20 2020-05-09 05:56:39 +10:00
amaitland 6c29d3b4e6 Core - Update CefErrorCode
Resolves #3106
2020-05-08 10:22:56 +10:00
amaitland c63c301451 Core - Improve IBrowserHost.NotifyMoveOrResizeStarted xml doc 2020-05-05 08:34:48 +10:00
amaitland 1824a0334d WPF/WinForms/OffScreen - CanExecuteJavascriptInMainFrame incorrectly false after loading page with different origin
Proof of concept for a workaround. The frameId for the second OnContextReleased that arrives after the OnContextCreated from
the old render process strangely has a frameId greater than the new frameId

TODO: Unit tests

Issue #3021
2020-05-04 12:34:47 +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 09661c6ac7 Core - PathCheck fix typo in comment 2020-05-03 19:31:51 +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 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 46006b4a44 Core - Add DependencyChecker.AssertPathAbsolute
Issue #3102
2020-05-01 11:03:30 +10:00
amaitland bce627097b Upgrade version number to 81.2.210 2020-04-27 17:45:53 +10:00
amaitland 14072b48e3 Core - ResourceHandler.Skip return true on successful seek 2020-04-23 17:07:06 +10:00
amaitland 296e75a775 Core - CefEventFlags fix capitalisation of AltGrDown
Was previously AltgrDown

Issue #3098
2020-04-18 20:31:04 +10:00
amaitland aef48bdd17 Core - CefEventFlags.AltGrDown Typo
Issue #3098
2020-04-18 14:52:41 +10:00
amaitland f46a8a7175 Core - Add CefEventFlags.AltGrDown
Resolves #3098
2020-04-18 10:55:27 +10:00
amaitland 0592d69784 Core - FolderSchemeHandlerFactory add protected virtual Create method
override Create to implement custom behaviour
2020-04-05 05:33:22 +10:00
amaitland 3ba0290676 WPF - Add IWebBrowser.IsBrowserInitialized explicit interface implementation
Can be called from any Thread, the ChromiumWebBrowser.IsBrowserInitialized property remains
as Dependency property.

Issue #3033
2020-03-26 09:10:36 +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 006445df03 MimeType - Add extra checking to Cef.GetMimeType
Also update the ResourceHandler.FromFilePath xml doc to reference Cef.GetMimeType

Issue #3041
2020-03-26 08:50:07 +10:00
Gilberto Stankiewicz 29e6a6d03a Fix a typo in an error message (#3087) 2020-03-26 08:37:02 +10:00
amaitland 30f2204f8e Xml Doc Improvements 2020-02-29 13:16:23 +10:00
amaitland 1761e93741 Core - DependencyChecker remove "natives_blob.bin" reference
Issue #3057
2020-02-28 11:10:23 +10:00
amaitland 2c5b07d2d0 Upgrade version to 80.0.40 2020-02-27 17:38:00 +10:00
amaitland 31c7e9957a Upgrade version number to 79.1.380 2020-02-27 15:24:18 +10:00
campersau 0d46348c20 Core - DomNode consistent code style (#3058) 2020-02-19 06:54:02 +10:00
amaitland 7100c3d0ec Core - Add Cef.WaitForBrowsersToClose helper function
- Add BrowserRefCounter to increment/decrement CefBrowser instance creation
- Add Cef.WaitForBrowsersToClose to dispose of all browser instances and call WaitForBrowsersToClose

Before calling CefShutdown it's important that CEF has finished closing/disposing of all the CefBrowser instances.
If you call CefShutdown before this has finished then you can get the error
"Check failed: !IsCefShutdown(). Object reference incorrectly held at CefShutdown".
This is more a problem when using MultiThreadedMessageLoop where CEF close/dispose happens on a different thread.
Calling ChromiumWebBrowser.Dispose will start to free the resources, CEF internally executes code on it's own thread.

#3047
2020-02-14 19:39:12 +10:00
amaitland 9dcb0ccad2 Core - Add IBrowserHost.TryCloseBrowser 2020-02-11 07:06:50 +10:00
amaitland 0772121f5f Core - ResourceHandler Add MimeType Mappings
Adding some newer video/audio/font mappings

#3041
2020-02-05 11:41:02 +10:00
amaitland 5780fb1f58 Core - ResourceHandler free resources in Dispose instead of Cancel
There is no example of Cancel in the source code and the description in the doc doesn't
really provide a clear explanation of it's intended use case.

See code comment for further details
2020-02-05 10:06:48 +10:00
amaitland bf41aa2d75 Core - ResourceHandler.Read only read as many bytes as can be written to DataOut
Previously we'd read too many bytes and attempting to write them to dataOUt would cause a see System.NotSupportedException

Resolves #3038
2020-02-05 07:12:08 +10:00
amaitland 961fc97c9d WebBrowserExtensions - Add missing semi colon 2020-01-31 08:16:34 +10:00
amaitland 499c6a80db WPF - ChromiumWebBrowser.GetBrowser() Throws InvalidOperationException if called on Non UI Thread.
- Extract error message out into a internal const so it's not duplicated
- Manually check InternalIsBrowserInitialized() method instead of using the extension method

Resolves #3032
2020-01-31 07:51:25 +10:00
amaitland 10d52419f3 xml doc improvements 2020-01-29 10:22:18 +10:00
amaitland 1b1cf522de Core - Update ReferrerPolicy enum values
**Breaking Change**

Resolves #3026
2020-01-29 05:36:55 +10:00
amaitland 39a305cac1 Xml Doc - Improvements and fixes
- Some classes are now excluded
- Many minor fixes should hopefully reduce the number of errors reported by Sandcastle
- Some of the xml doc is generated by Atomineer, usually in cases where CEF lacks documentation
2020-01-29 05:36:54 +10:00
amaitland ad2c1756f9 Core - Add IBrowserHost.GetNavigationEntriesAsync extension method 2020-01-24 10:51:29 +10:00
amaitland 1155ef107c Core - ResourceHandler set Stream.Position = 0 and if CanSeek
- Prior to version 75 the Stream.Position was set to 0 before the ResourceHandler would read the Stream.
This restores that behaviour.
- Minor refactor of if statement for Stream.Can seek, only override ResponseLength with Stream.Length of not already set

Resolves #2903
2020-01-23 07:56:13 +10:00
amaitland 44113d77a4 DevTools - now shown as popup (visible in taskbar).
- Pass null for CefWindowInfo.SetAsPopup parent handle
- Add optional params to IWebBrowser/IBrowser.ShowDevTools extension methods.

Anyone wishing to use the old behaviour can do something like

var host = browser.GetBrowserHost();

var windowInfo = new WindowInfo();
windowInfo.SetAsPopup(host.GetWindowHandle(), "DevTools");

browser.ShowDevTools(windowInfo);

Resolves #2997
2020-01-21 09:06:28 +10:00