Commit Graph

6179 Commits

Author SHA1 Message Date
Alex Maitland 929470e5bc WinForms Example - Remove MultiFormFocusHandler
- No longer needed as it's identical to the DefaultFocusHandler implementation.
- Minor code cleanup, no longer need to pass through multithreadedmessageloop param
2021-07-29 11:11:39 +10:00
Alex Maitland e5f2381351 WinForms/WPF/OffScreen - Use custom FocusHandler when disposing to block taking focus
This was added as a workaround for Issue #3715 which is specific to WinForms
and will hopefully be fixed upstream.

I've added the logic to all three implementations as I think the behaviour should be
consistent across all implementations.
2021-07-27 13:13:17 +10:00
Alex Maitland f48c6567ea WinForms Example - Remove redundant code
The Focus handler when multithreaded message loop = true is already null as
we check if running on CEF UI Thread before creating the instance in the ChromiumWebBrowser.OnAfterBrowserCreated
2021-07-27 13:06:49 +10:00
campersau 9a37ebdbd3 DevTools Client - Generic ExecuteDevToolsMethodAsync and add RegisterEventHandler (#3674)
* Make ExecuteDevToolsMethodAsync generic

* Make RegisterEventHandler generic

* PR feedback and added test for registering multiple event handlers

* Updated generated code to latest version

* Fix possible NRE when removing event listener before adding one
2021-07-26 12:01:46 +10:00
Alex Maitland 8fb2e414b6 Nuget - Manually copy CefSharp Common files after initial Nuget restore
Follow up to https://github.com/cefsharp/CefSharp/commit/24d64c427e8d41709230baf460cb8c803048dc54
2021-07-24 16:13:10 +10:00
campersau b83bebb042 WPF - Simplify Support Shift + AltGr (#3701) 2021-07-24 15:46:44 +10:00
Alex Maitland 0a1a8855c5 Core - Add IBrowser.IsValid
- Add IBrowser.IsValid
- Update xml doc comments
- Remove ExecuteScriptAsync CanExecuteJavascriptInMainFrame check as CEF should now internally queue commands for ExecuteScript and LoadRequest

https://bitbucket.org/chromiumembedded/cef/issues/2421/add-onframecreated-onframedeleted#comment-60616371

Issue #3588
2021-07-22 13:27:36 +10:00
Alex Maitland 823a6582a9 Upgrade to CEF 92.0.16+g3492b1b+chromium-92.0.4515.107 / Chromium 92.0.4515.107 2021-07-22 13:11:02 +10:00
Alex Maitland 37231bcd9b WPF Example - Add namespace qualifier to WpfImeKeyboardHandler
Use the full namespace instead to make it clearer (technically the partial namespace prefix will work).

Replaces #3607
2021-07-22 10:40:43 +10:00
Alex Maitland 66cd9ef4b8 WPF - Improve WpfIMEKeyboardHandler browserHost null checks
CancelComposition is now private as it's not used outside the scope of the class. Technically this is a breaking change
though it's incredibly unlikely this method was used outside the scope of WpfImeKeyboardHandler as it requires
the Hwnd which is obtained from the SourceHook which is private.

We can and probably should make most of the private methods protected virtual to allow for overriding of just a small
portion of the class, you currently can copy and paste the whole class into your own code base if small changes are required.

#3690
2021-07-22 10:33:32 +10:00
Shaojun Li d9a7a398cb WPF - Fix WpfIMEKeyboardHandler crash when browser is not initalized. (#3690)
GetBrowserHost will throw exception when browser is not initalized.
2021-07-22 10:17:21 +10:00
Alex Maitland 20dad8aced Core - Crash opening popup window
Upstream changes mean that extraInfo can now be null (https://bitbucket.org/chromiumembedded/cef/issues/3123/convert-legacy-ipc-messages-to-mojo)
We currently only send extra Info for the main browser and not for popups.
Assign the _jsBindingPropertyName/_jsBindingPropertyNameCamelCase properties
by default and only update when the user has specified their own name.

It's not currently possible to have different naming in the same render process (was previously the case).

Issue #3670
2021-07-06 11:56:35 +10:00
Alex Maitland 4ef267cabf Upgrade to CEF 92.0.14+gadd734a+chromium-92.0.4515.81 / Chromium 92.0.4515.81 2021-07-06 11:30:44 +10:00
Alex Maitland 1d1b6f2e4d Core - Xml Doc improvements/fixes 2021-07-05 11:38:55 +10:00
Alex Maitland 4a20b19e6b Test - Minor cleanup 2021-07-05 11:16:25 +10:00
Alex Maitland 102f70d30b DevTools Client - Follow up to #3669
- Improve xml doc
- Reduce code duplication
2021-07-05 11:11:40 +10:00
campersau b8896da54d DevTools - Support strongly typed events (#3669)
Includes various other DevTools fixes:
- JavaScript "number"s are represented as doubles instead of longs
- Headers are now correctly serialized / deserialized
- DevToolsDomainErrorResponse is now correctly deserialized
2021-07-05 10:32:22 +10:00
Alex Maitland a7dc73b681 Update README.md and cefclient links 2021-06-27 20:58:56 +10:00
Alex Maitland 6194fe674d Core - MethodRunnerQueue add additional IsCancellationRequested checks 2021-06-25 16:42:01 +10:00
Alex Maitland 0f691b678e Test - Add MethodRunnerQueueFacts.DisposeQueueThenEnqueueMethodInvocation
Test to validate that MethodRunnerQueue doesn't have the same issues as #3639
2021-06-25 16:37:37 +10:00
Alex Maitland 47f3bcd468 Nuget - Only run CefSharpExcludeCoreRuntimeBeforeGenerateApplicationManifest for packages.config projects
When using Non SDK Stlye project with PackageReference and publishing with ClickOnce the CefSharp.Core.Runtime.*
files were missing from the installer.

Far as I can tell ClickOnce publishing isn't supported for SDK Style projects so just disable for PackageReference for now

https://github.com/cefsharp/CefSharp/discussions/3613#discussioncomment-913061
2021-06-25 14:29:52 +10:00
Alex Maitland 4ab6d2ad25 Core - ConcurrentMethodRunnerQueue.Enqueue throws InvalidOperationException
When ConcurrentMethodRunnerQueue.Dispose is called from a different thread it appears that
the CancellationTokenSource is cancelled (via Dispose) inbetween creation of the Task
and calling Task.Start(TaskScheduler).

Switch from using Task constructor and Task.Start to the preferred Task.Run method.

Added additional unit tests.

Issue #3639
2021-06-25 14:08:50 +10:00
Alex Maitland 445fb9ab2d Example/Test - Use the new CefRedist32CopyResources/CefRedist64CopyResources targets
On Nuget restore the CefRedist32/CefRedist64 properties aren't accessible until after the project has been closed
and reopened. (Think clean checkout where the packages folder doesn't exist).
The Targets behave different and can be called, so this works around the problem.
2021-06-21 15:46:42 +10:00
Alex Maitland 6e4ef2171c Upgrade to CEF 92.0.9+g847fba0+chromium-92.0.4515.51 / Chromium 92.0.4515.51 2021-06-21 15:40:35 +10:00
ptrsky 136b928c0e WPF - Add support for Shift+AltGr (#3627)
* WPF - Add support for Shift+AltGr

The handling of AltGr characters in CefBrowsterHostWrapper did not cover capital diacritic letters. This commit adds handling for the Shift + AltGr + character combination.

* WPF - Shift+AltGr review fixes

* Trigger rebuild
2021-06-21 15:15:58 +10:00
Alex Maitland 42ffee0bcd Test - Add DevToolsClientFacts.CanCaptureScreenshot
- Capture screenshot, load data and confirm width/height match browser
2021-06-21 10:25:56 +10:00
Alex Maitland ff19eaa005 Net Core - Update RefAssembly source 2021-06-18 16:22:07 +10:00
Alex Maitland 47b47617c1 Net Core - Examples/Test Copy Swiftshader and Locale folders
When ARM64 support was added the switch to the new chromiumembeddedframework.runtime was made
It's actually CefSharp.Common.NETCore that does the copying of SwiftShader and Locales
Update CefSharp.AfterBuild.targets to include the two folders.
2021-06-18 16:18:59 +10:00
Alex Maitland d842a2583a Test - CanLoadExpiredBadSsl can now validate CefErrorCode
With PR https://bitbucket.org/chromiumembedded/cef/pull-requests/373
it's possible  to get the certificate error in OnLoadError so now
LoadUrlAsync returns the correct CefErrorCode
2021-06-18 16:08:51 +10:00
Alex Maitland 42e9433fdd Nuget - Disable AnyCPU check for BuildTransitive Library Projects
Issue #3622
2021-06-18 15:54:01 +10:00
Alex Maitland 24d64c427e Nuget - Manually copy files after initial Nuget restore
One final attempt to workaround https://github.com/dotnet/project-system/issues/4158

The None/Content entries aren't picked up as the .targets file doesn't exist before the Nuget restore (only when using packages.config)
Attempt to copy the files via calling CefRedist32CopyResources/CefRedist64CopyResources tasks.
Properties aren't accessible, I believe that tasks should be, so hopefully this copies the files.

Build actions like Publish are very unlikely to work correctly as the files won't have been included via the <Content/> entries.
2021-06-18 15:48:06 +10:00
Alex Maitland ac0ef70a67 Core - Update FileThreadTaskFactory thread
TID_FILE was removed in commit https://bitbucket.org/chromiumembedded/cef/commits/ff8f4a7217189645a98b8affc45641cafe232f73
Use TID_FILE_BACKGROUND
2021-06-18 15:29:38 +10:00
Alex Maitland 49db956bb8 Upgrade to CEF 92.0.8+gd7c630a+chromium-92.0.4515.51 / Chromium 92.0.4515.51 2021-06-18 15:16:14 +10:00
Alex Maitland 0d6e56dd7a DevTools Client - Fix Net Core build error 2021-06-10 15:51:02 +10:00
Alex Maitland 8e06cbcbad DevTools Client - Update to Chromium 91.0.4472.77 2021-06-10 10:31:49 +10:00
Alex Maitland 55ee948e51 README.md - Update as 91.1.60-pre has been released 2021-06-10 10:31:32 +10:00
Alex Maitland ae22e3ae88 Test - JsBindingGlobalApiDisabled ensure page loaded successfully 2021-06-05 14:37:49 +10:00
Alex Maitland 91eb0d4a85 Core - OwinResourceHandler RequestQueryString remove leading '?'
Uri.Query returns the leading '?', as per the OWIN spec the leading '?' needs to be removed
owin.RequestQueryString | A string containing the query string component of the HTTP request URI, without the leading "?" The value may be an empty string.

Issue https://github.com/amaitland/Chromium.AspNetCore.Bridge/issues/7
2021-06-05 14:37:48 +10:00
Alex Maitland 33f9058cdf WinForms - IWinFormsWebBrowser now implements IWin32Window, IComponent, ISynchronizeInvoke
Allows access to methods like BeginInvoke()
2021-06-05 14:37:48 +10:00
Alex Maitland 77aed487c9 WinForms - Hide/Show internal browser when Visible change
- ChromiumHostControl Add On OnVisibleChanged override
- ChromiumHostControl reorder OnSizeChanged so resize
  happens before event for consistency

Follow up to #2922
2021-06-05 14:37:48 +10:00
Alex Maitland e231bc72d2 Revert "WPF/WinForms/OffScreen - Enable Chromium Site Isolation"
This reverts commit 9943333397.
2021-06-05 09:33:44 +10:00
Alex Maitland cd334e5686 Test - Upgrade LoadRequestAsync extension to handle load errors 2021-06-05 09:32:32 +10:00
Alex Maitland 1fb3f17599 AnyCPU - Add CefRuntime.SubscribeAnyCpuAssemblyResolver/LoadCefSharpCoreRuntimeAnyCpu
Simplify using CefSharp when targeting AnyCPU, it's now possible to include this as library code
now that CefSharp.dll targets AnyCPU.

There is no .Net Core/.Net 5.0 implementation of this class as the CefSharp.Core.Runtime.dll
is already loaded dynamically based on architecture.

- Call CefRuntime.LoadCefSharpCoreRuntimeAnyCpu to immediately load the CefSharp.Core.Runtime.dll
and all dependant resources will be loaded based on this instance
- Call LoadCefSharpCoreRuntimeAnyCpu.SubscribeAnyCpuAssemblyResolver to use load assembly
  when required.
2021-06-04 16:57:53 +10:00
Alex Maitland d8abfa6035 Example - AudioHandler now extends CefSharp.Handler.AudioHandler
Fixes compile error as IAudioHandler now implements IDisposable
2021-06-04 16:57:53 +10:00
Alex Maitland a6ff42ee6f Core - IAudioHandler now implements IDisposable
IAudioHandler.Dispose is called when the ChromiumWebBrowser instance is being Disposed.

This is a breaking change.

Resolves #3598
2021-06-04 15:49:52 +10:00
Alex Maitland e1ac768a42 Core - Update CefThreadIds enum
This is a breaking change

Resolves #3597
2021-06-04 15:29:48 +10:00
Alex Maitland 9943333397 WPF/WinForms/OffScreen - Enable Chromium Site Isolation
CEF has changed it's behaviour slightly to correctly support Chromium Site Isolation
Frame objects (including for the main frame) will now always change after
cross-origin navigation, and the old frame object will be invalidated.
See commit for additional details https://bitbucket.org/chromiumembedded/cef/commits/d9efaee9b9aa

Resolves #2967
2021-06-04 15:10:42 +10:00
Alex Maitland 7dfead360e WPF - IWpfWebBrowser implement IInputElement
Simplify setting Focus from View model as now possible to call Keyboard.Focus(IWpfWebBrowser);

Resolves #3546
2021-06-04 15:10:41 +10:00
Alex Maitland 3dc37b2dd2 WinForms - Add LifeSpanHandler implementation capable of hosting popups as Tabs/Controls (#3529)
* WinForms - Add LifeSpanHandler implementation capable of hosting popups  as Tabs/Child controls in WinForms

- Update Example
- Remove PopupAsChildHelper and example LifeSpanHandler
- Examples always opens popups as tabs now.
- Improve xml doc and comments
- Make ParentFormMessageInterceptor public
- Make ChromiumHostControl public, move into CefSharp.WinForms.Host namespace
  Rather than having the class in the CefSharp.WinForms namespace and potentially
  confuse users, move into it's own namespace.
- Clarify ShowDevToolsDocked needs to be used with the new WinForms lifespan handler
2021-06-04 14:51:49 +10:00
Alex Maitland 2371370e64 Test - Update to use LoadUrlAsync 2021-06-04 14:39:44 +10:00