6021 Commits

Author SHA1 Message Date
Alex Maitland b50c60e065 Upgrade to CEF 97.1.6+g8961cdb+chromium-97.0.4692.99 / Chromium 97.0.4692.99 v97.1.60 2022-01-22 12:44:09 +10:00
Alex Maitland 49707da5a7 Core - CefResourceRequestHandlerAdapter.GetCookieAccessFilter object reference not set to an instance of an object.
For resource requests that are handled by CefRequestContextHandlerAdapter::GetResourceRequestHandler
then _browserControl field will be null, added additional checks before calling TryGetBrowserCoreById

Follow up to https://github.com/cefsharp/CefSharp/commit/4ade0b8284d4f95f763c471a867139bff2bac2a9

Issue #3967
v97.1.12
2022-01-18 11:04:59 +10:00
campersau e31faa6ca9 OffScreen - Fix ResizeAsync with deviceScalingFactor (#3964)
* OffScreen - Fix ResizeAsync with deviceScalingFactor

* OffScreen - Fix CaptureScreenshotAsync Width / Height calculation to include X and Y

Always apply Scale changes
2022-01-18 11:04:59 +10:00
campersau 7f1aa6ee5a Core - Update CefErrorCode (#3965)
Using https://raw.githubusercontent.com/chromium/chromium/97.0.4692.71/net/base/net_error_list.h
2022-01-18 11:04:59 +10:00
campersau 10ade486a2 Test - Fix CanEvaluateDoubleValues by not relying on the current culture (#3966) 2022-01-18 11:04:59 +10:00
Alex Maitland 1f79515359 WPF - Update CleanupElement when PresentationSource changes
- If the CleanupElement is a Window then move it to the new Window
v97.1.11
2022-01-15 11:19:16 +10:00
Alex Maitland ec7c4f7b04 OffScreen - CaptureScreenshotAsync only resize if larger and support clip 2022-01-15 10:24:24 +10:00
Alex Maitland 4ee889f6d0 Test - Skip LoadJavaScriptBindingQunitTestsSuccessfulCompletion
Issue #3867
v97.1.10-pre
2022-01-11 12:12:38 +10:00
Alex Maitland 06d485b4d0 DevTools Client - Upgrade to 97.0.4692.71 2022-01-11 09:55:05 +10:00
Alex Maitland 086d02e62e WinForms - Add ChromiumWebBrowser.FromBrowser static method
- Can be used to get ChromiumWebBrowser instance from IBrowser instance
- Added generic base implementation to reduce code duplication
2022-01-10 14:10:57 +10:00
Alex Maitland 1c29eda942 README.md - Update release tab as version 97 is coming soon 2022-01-10 13:41:43 +10:00
Alex Maitland 0243876795 WinForms - Add LifeSpanHandler.OnBeforePopupCreated
- Allow for cancelling of popup creation

browser.LifeSpanHandler = CefSharp.WinForms.Handler.LifeSpanHandler
	.Create()
	.OnBeforePopupCreated((chromiumWebBrowser, b, frame, targetUrl, targetFrameName, targetDisposition, userGesture, browserSettings) =>
	{
		//Can cancel opening popup based on Url if required.
		if(targetUrl?.StartsWith(CefExample.BaseUrl + "/cancelme.html") == true)
		{
			return PopupCreation.Cancel;
		}

		return PopupCreation.Continue;
	})
2022-01-10 13:40:42 +10:00
Alex Maitland 455c6f2c52 Core - ResourceRequestHandler now passes a long lived instance of IBrowser
- The methods in CefResourceRequestHandlerAdapter previously passed on a scoped instance of
  IBrowser which would have been disposed when the method was executed. This made it very
  difficult to use the callback in OnBeforeResourceLoad so now we check to see if we
  already have an IBrowser instance with the matching Id and only use a scoped instance
  if we don't have a match.
2022-01-10 10:36:39 +10:00
Alex Maitland 8b23c616b4 WinForms - Allow creation of custom ChromiumHostControl instance
- Add new CreatePopupChromiumHostControl delegate which can be passed to
  LifeSpanHandler.Create to create a new ChromiumHostControl instance.
  You can create a class that inherits from ChromiumHostControl and add
  additional functionality.

LifeSpanHandler
  .Create(() =>
  {
     return new ChromiumHostControl
     {
       Dock = DockStyle.Fill
     };
})
2022-01-10 10:17:14 +10:00
Alex Maitland d91cf0515b Core - Further migration of extensions methods from IWebBrowser to IChromiumWebBrowserBase
- EvaluateScriptAsync can now be used from IChromiumWebBrowserBase, if also IWebBrowser then
main frame check will occur as previous.

Related to #3944
2022-01-10 10:02:09 +10:00
Alex Maitland 123e4b7daf Core - IFrame.EvaluateScriptAsPromiseAsync add javascriptBindingApiGlobalObjectName
- Defaults to null, only required if you set JavascriptBindingSettings.JavascriptBindingApiGlobalObjectName
2022-01-10 09:53:46 +10:00
Alex Maitland 45d9ec43cc appveyor.yml - Update as release branch 2022-01-10 09:50:30 +10:00
Alex Maitland fc08c462dc Upgrade to CEF 97.1.1+g50067f2+chromium-97.0.4692.71 / Chromium 97.0.4692.71 2022-01-10 09:49:57 +10:00
Alex Maitland 487723b080 Core - Change WebBrowserExtensions replace IWebBrowser with IChromiumWebBrowserBase where possible
- Improve xml doc comments also
2022-01-10 09:43:54 +10:00
Alex Maitland eb225f6252 Core - ExecuteScriptAsync(script) incorrectly appends braces and semicolon to script.
Issue #3944
2022-01-10 09:43:54 +10:00
Alex Maitland 604e9570f7 WinForms - Improve xml doc 2022-01-05 13:20:33 +10:00
Alex Maitland 00254b9377 README.md - Add CefSharp.Wpf.HwndHost package links 2022-01-05 13:14:17 +10:00
Alex Maitland d45aaff7ca Upgrade to CEF 97.0.11+g695453b+chromium-97.0.4692.71 / Chromium 97.0.4692.71 2022-01-05 10:54:41 +10:00
Alex Maitland 463df86f3c UpdateNugetPackages.ps1 - Update assembly/build version as part of script
- UpdateNugetPackages.ps1 now calls .\build.ps1 -Target update-build-version
2022-01-05 10:52:14 +10:00
Alex Maitland d0c9adcf9d Core - Add TryGetBrowserCoreById
- Can be used to obtain an IBrowser reference by Browser Identifier (Id).
- Added a couple of basic unit tests.
2022-01-05 10:47:48 +10:00
Alex Maitland 27816d54b8 Core - Change from using GetBrowser() method to BrowserHost
- BrowserHost will return null if not set where GetBrowser() will throw an exception
2022-01-05 10:14:24 +10:00
Alex Maitland 6f0f20f3b2 DevTools - Add SetMainFrameDocumentContentAsync extension method
- Updated example error handlers to use SetMainFrameDocumentContentAsync for displaying error messages
  so back/forward navigation works correctly.
- DevToolsExtensions updated to use IChromiumWebBrowserBase instead of IWebBrowser so they're usable
  for WinForms hosted popups

Issue #2985
2022-01-05 10:09:56 +10:00
Alex Maitland f90271fb14 WPF - Improve Mouse Click Count
Chromium only supports values of 1,2,3 for clickCount so we
set click count to 1 if greater than 3

Resolves #3940
2022-01-04 10:44:31 +10:00
Alex Maitland d833c5e761 WinForms - ChromiumHostControl close CefBrowser on Dispose
- If you were to remove the ChromiumHostControl from it's parent Control and manually call Dispose()
  then the underlying CefBrowser wouldn't have been closed until the parent ChromiumWebBrowser is
  Disposed (all popups are disposed)
2022-01-04 10:31:36 +10:00
Alex Maitland dfc627efc5 Bug Report - Update cefclient version to 96.0.18 2022-01-04 10:14:41 +10:00
Alex Maitland f07be8c5e5 build.ps1 - Add new update-build-version target
Updated Version/AssemblyVersion

Performs some unnecessary tasks, so could be improved
2021-12-16 13:02:24 +10:00
Alex Maitland cbe0e855c6 WinForms - check if MainFrame.IsValid before calling LoadUrl
- Rewrite to directly use BrowserCore checking for null and IsDisposed to
avoid exceptions if at all possible.
- Check MainFrame.IsValid

As yet I've not seen a way to reproduce the actual problem, single reported case
so far at https://github.com/TV-Rename/tvrename/issues/862
2021-12-15 09:27:18 +10:00
Alex Maitland ba7c855353 WinForms - NullReferenceException in ChromiumWebBrowser.OnHandleDestroyed
- Check browserHost is not null

Resolves #3931
2021-12-15 09:11:18 +10:00
Alex Maitland 57d7b48f8d BrowserSubProcess - Change SetProcessShutdownParameters priority to 0x200
- Change to 0x200 which is low end of 'Application reserved "in between" shutdown range.'
- Remove logging as it wasn't working, must be too early to use the LOG(INFO) CEF macro

Test with a GetProcessShutdownParameters in debugger shows working e.g.

if (SetProcessShutdownParameters(0x200, SHUTDOWN_NORETRY))
{
	DWORD level = 0;
	DWORD flags = 0;
	GetProcessShutdownParameters(&level, &flags);
}

Issue #3155
2021-12-09 10:07:53 +10:00
Alex Maitland a6a66bed06 VS2022 - Very basic support for VS2022
Opening either solution in VS2022 should no longer prompt to upgrade VC++ version/Win10 SDK.

Having both VS2019 and VS2022 installed might be a problem if VS2022 doesn't have the required components installed.

Update .vsconfig Win10 SDK version to 19041 (same as Chromium requires for build)
2021-12-08 10:45:31 +10:00
Alex Maitland a79e83940b Net Core - Update Ref Assembly 2021-12-08 10:32:33 +10:00
Alex Maitland 8160ec1ce4 Remove IRequestContextHandler.OnBeforePluginLoad and IRequestContext.PurgePluginListCache
Resolves #3924
2021-12-07 14:54:11 +10:00
Alex Maitland f619a1a194 Upgrade to CEF 97.0.8+g4eb2da6+chromium-97.0.4692.36 / Chromium 97.0.4692.36 2021-12-07 14:46:51 +10:00
Alex Maitland 4313c9a25f BrowserSubprocess - Update shutdown priority (SetProcessShutdownParameters)
Issue #3155
2021-12-07 14:40:53 +10:00
Alex Maitland 51b2c74801 Core - Fix ExecuteScriptAsync infinite recursion
Resolves #3914
2021-12-01 05:47:01 +10:00
Alex Maitland b72d41353e WinForms - Improve hosting of popups using ChromiumHostControl
- Add IChromiumWebBrowserBase which is can be used for ChromiumWebBrowser instances and ChromiumHostControl
- Reduce code duplication for extensions methods
- Update WinForms Example
2021-11-30 13:47:42 +10:00
Alex Maitland 6e211bcc7f Wpf - Context Menu improvements/fixes
- Fix separator not showing
- Remove unused code
- Add consts for devtools menu command id's
2021-11-30 13:47:42 +10:00
Alex Maitland 165a05071d WinForms - ChromiumHostControl now has basic events
- Create ChromiumHostControlBase as common base class for ChromiumHostControl and ChromiumWebBrowser
- ChromiumHostControl is now the specific implementation for hosting popups
  Has AddressChanged, LoadingStateChanged, etc events
2021-11-30 13:47:41 +10:00
EmilyPaek 6f73ea1bba WPF - Korean IME fix cursor displayed at the left side of current character (#3912)
Co-authored-by: agrina1008 <noely1008@naver.com>
2021-11-30 13:47:16 +10:00
Alex Maitland eb21ea8c97 README.md - Update contact links
Use discussions for questions
2021-11-25 17:23:49 +10:00
Alex Maitland a84f623e8e DevTools Client - Upgrade to 96.0.4664.55 2021-11-25 13:36:44 +10:00
Alex Maitland 89b66f58d7 WPF - Use WPF specific menu handler by default
Resolves #1767
2021-11-25 11:09:38 +10:00
Alex Maitland 1b007b0ef5 README.md - Update in preparation for creation of 96 release branch 2021-11-25 11:03:26 +10:00
Alex Maitland 4d7c354f63 Update build number to 96.0.140 2021-11-25 11:01:57 +10:00
Alex Maitland 6e9e4a90a2 WinForms - ChromiumHostControl add BrowserCore and IsBrowserInitialized event
- Can now access the IBrowser property via ChromiumHostControl.BrowserCore
- The ChromiumHostControl.IsBrowserInitialized event will be raised when
the underlying CEF browser has been created.
2021-11-25 10:55:31 +10:00