Commit Graph

1500 Commits

Author SHA1 Message Date
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 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 b71381980c Core - Remove unused files
They were renamed (spelling mistake) and the old ones seem to have been retained,
probably a merge issue
2020-05-02 07:17:43 +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 bce627097b Upgrade version number to 81.2.210 2020-04-27 17:45:53 +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 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 defc2c3af6 WinForms - Remove WS_EX_NOACTIVATE style on initial page Load
- When LoadingStateChanged occurs we remove the ExStyle WS_EX_NOACTIVATE flag
- Previous change to the FocusHandler was reverted in 917480da3b

Updated to match the cefclient example
https://github.com/chromiumembedded/cef/blob/9df4a54308a88fd80c5774d91c62da35afb5fd1b/tests/cefclient/browser/root_window_win.cc#L1088

Resolves #2776
2020-04-06 10:48:53 +10:00
amaitland 955b3f3c1a Core - Consistent C++ naming
- Following the adapter/wrapper naming scheme
- Moved classes to internals that aren't public facing

Resolves #1005
2020-04-06 06:50:32 +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 270b5c496e WinForms - Dispose of FrameworkCreated BrowserSettings when Control Disposed
If BrowserSettings is FrameworkCreated we dispose of the BrowserSettings object immediately,
this code was in ManagedCefBrowserAdapter::CreateBrowser, now it's duplicated in WPF/OffScreen

The WinForms version has a slightly different behaviour, we keep the browserSettings reference
until the Control is Disposed incase the Control handle is destroyed then Created again.

Issue #2840
2020-04-01 09:42:56 +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 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
amaitland d1279810ff Disable System Wide Flash Installation by Default
Can be re-enabled for a limited time using the enable-system-flash command line arg

Resolves #3048
2020-02-28 11:14:50 +10:00
amaitland 2c5b07d2d0 Upgrade version to 80.0.40 2020-02-27 17:38:00 +10:00
amaitland ec95a7245b Upgrade to CEF 80.0.4+g74f7b0c+chromium-80.0.3987.122 / Chromium 80.0.3987.122 2020-02-27 16:51:17 +10:00
amaitland 31c7e9957a Upgrade version number to 79.1.380 2020-02-27 15:24:18 +10:00
amaitland 6c14b9239a Upgrade to CEF 79.1.38+gecefb59+chromium-79.0.3945.130 / Chromium 79.0.3945.130 2020-02-27 15:24:17 +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 eb9ddc6389 Core - Remove ClientAdapter::ThrowUnknownPopupBrowser (unused) 2020-02-14 19:39:11 +10:00
amaitland ce698480e3 Core - ClientAdapter::OnAfterCreated pass in the newly created wrapper directly
Minor code cleanup
2020-02-14 19:39:11 +10:00
amaitland 726f762f57 Core - IBrowser.TryCloseBrowser throw exception if called on invalid thread
Can only be called on the CEF Ui thread.
https://github.com/chromiumembedded/cef/blob/9df4a54308a88fd80c5774d91c62da35afb5fd1b/libcef/browser/browser_host_impl.cc#L608
2020-02-11 10:32:46 +10:00
amaitland 9dcb0ccad2 Core - Add IBrowserHost.TryCloseBrowser 2020-02-11 07:06:50 +10:00
amaitland 8706aadd3f CefSettings - Update GPU Disabled comments regarding WebGl
Swiftshader will be used for CPU based software rendering
2020-02-01 12:17:58 +10:00
amaitland 94ae6bea17 Upgrade to CEF 79.1.36+g90301bd+chromium-79.0.3945.130 / Chromium 79.0.3945.130 2020-01-31 10:59:33 +10:00
Gilberto Stankiewicz e011086883 Fix all C6246 warnings: Local declaration hides declaration of the same name in outer scope. (#3027)
* Fix all C6246 warnings: Local declaration hides declaration of the same name in outer scope.

* Removing outter scope `global`
2020-01-29 16:17:14 +10:00
amaitland 27cae10f15 Upgrade to CEF 79.1.35+gfebbb4a+chromium-79.0.3945.130 / Chromium 79.0.3945.130 2020-01-29 05:52: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 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
amaitland 1550251940 Upgrade to CEF 79.1.31+gfc9ef34+chromium-79.0.3945.117 / Chromium 79.0.3945.117 2020-01-21 08:56:08 +10:00
amaitland 94e311844c Upgrade to CEF 79.1.10+g7ec49fa+chromium-79.0.3945.117 / Chromium 79.0.3945.117 2020-01-15 11:16:39 +10:00
amaitland 1ef327cf9d Upgrade to CEF 79.1.3+ga5342ed+chromium-79.0.3945.88 / Chromium 79.0.3945.88 2020-01-08 16:46:48 +10:00
amaitland a6f4f75a0e Core - Add Cef.GetMimeType
Use the Chromium file extension to MimeType mapping.
The built in ResourceHandler.GetMimeType needs updating, doesn't support say webm for example.
2019-12-11 17:46:16 +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 93336a0031 Core - CefSettings add disable-site-isolation-trials and remove process-per-site-instance arg
Steps towards supporting Chromium Site Isolation

Issue #2967
2019-12-04 09:22:44 +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 617e43cebf Upgrade to CEF 78.3.9+gc7345f2+chromium-78.0.3904.108 / Chromium 78.0.3904.108 2019-11-28 12:04:02 +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 ec8d58bcec Core - Rename CefSharp.Internals.CefUrlRequestWrapper to CefSharp.UrlRequest
- Make public
- Add public constructor
2019-11-23 15:11:14 +10:00
amaitland 493897983d Core - Rename CefSharp.Internals.CefRequestWrapper to CefSharp.Request
- Made public
- Added public constructor

Related issue #1721
2019-11-23 14:27:27 +10:00
amaitland b8418f4045 Core - CefRequestWrapper code cleanup
- Variable rename
2019-11-23 14:12:25 +10:00
amaitland 8b8dbad3d1 Core - Rename CefSharp.Internals.CefPostDataWrapper to CefSharp.PostData
- Made public
- Added public constructor

Related Issue #1721
2019-11-23 14:09:37 +10:00
amaitland dbc2293d8f Core - Rename CefSharp.Internals.CefPostDataWrapper to CefSharp.PostDataElement
- Make public
- Added public constructor

Related issue #1721
2019-11-23 14:04:16 +10:00
Nick 876d3f9ecf Add IRequestContext.ClearHttpAuthCredentials (#2959)
Add IRequestContext.ClearHttpAuthCredentials
2019-11-18 13:13:30 +11:00