* NetCore - Upgrade minimum version to 5.0
* Update platform target
* Change to windows 10 specific TFM for top level packages
* Upgrade to .Net 6
* Nuget - Update packages
* Net Core - Fix dotnet test path
* Add Test Sdk and update Runner
---------
Co-authored-by: amaitland <307872+amaitland@users.noreply.github.com>
- Extend IWinFormsChromiumWebBrowser to make it easier to access CanSelect/Select methods
- Update example to call Select() after LoadUrl call
Resolves#4965
- GetAuthCredentials won't be called otherwise, those wishing to use the Chrome password
prompt can remove the command line arg at runtime.
Resolves#4830
* Ensure reference assemblies are copied to output folders
The .NET 6.0 SDK introduced a breaking change meaning that reference
assemblies are no longer automatically copied from the intermediate
build directory to the output directory. An additional MsBuild property
is now required.
* Specify VS2022 for reference assembly copy condition
---------
Co-authored-by: Bernard Mason <bernard.mason@thinksmartbox.com>
* Upgrade minimum .Net version to 4.6.2
#4433
* Use TaskCreationOptions.RunContinuationsAsynchronously
- Now that min version is .Net 4.6.2 we can use RunContinuationsAsynchronously
- Remove some unused code
- If the popup is being hosted on a Form that is being Closed/Disposed
as we attempt to call Control.Invoke we can end up with an ObjectDisposedException
- Call CefBrowserHost.SetFocus(true) on the WinForms UI Thread to
workaround upstream issue, see code comment for more detail.
- Add OnSetInitialFocus to allow for providing custom behaviour
- MultiThreadedMessageLoop = false gets focus correctly from parent, no need
to call SetFocus(true)
https://bitbucket.org/chromiumembedded/cef/issues/3436/chromium-based-browser-loses-focus-when
- Previously when no Scale was specified, then the previous ChromiumWebBrowser scale was used.
- Now Viewport defaults to a scale of 1, so the behaviour has been changed so the scale passed as
the param is always used.
- Test updated
This is a minor breaking change.
Resolves#4091
- Simplification of calling the DevTools method
- Moved GetContentSizeAsync from OffScreen into partial class (now accessible from WinForms/WPF/OffScreen).
- Added menu option
Resolves#4081
- Add new WaitForNavigationAsync method
- Change LoadUrlAsync to return CefErrorCode.Failed for HttpStatusCode = -1 (better represents there was an error)
Example:
var navigationTask = browser.WaitForNavigationAsync();
var evaluateTask = browser.EvaluateScriptAsync($"window.location.href = '{expected}';");
await Task.WhenAll(navigationTask, evaluateTask);
var navigationResponse = navigationTask.Result;
Resolves#4073
Current DesignMode property is only true when the control is directly interacting with the designer.
This checks if an ancestor is in design mode to allow support for UserControls
Issue #4057
- 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
};
})
- 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)
- 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
- Add IChromiumWebBrowserBase which is can be used for ChromiumWebBrowser instances and ChromiumHostControl
- Reduce code duplication for extensions methods
- Update WinForms Example
- Create ChromiumHostControlBase as common base class for ChromiumHostControl and ChromiumWebBrowser
- ChromiumHostControl is now the specific implementation for hosting popups
Has AddressChanged, LoadingStateChanged, etc events
- Can now access the IBrowser property via ChromiumHostControl.BrowserCore
- The ChromiumHostControl.IsBrowserInitialized event will be raised when
the underlying CEF browser has been created.
- Initial intention was to have a reusable method that could be used CefSharp.Wpf.HwndHost,
upon further deliberation I've decided to build the functionality into the ChromiumWebBrowser.Partial.cs
and will need to duplicate the functionality in CefSharp.Wpf.HwndHost. This guarantees that the
Task will be resolved in all cases. The previous implementation there was a theoretical change we'd
miss subscribing to the relevant events
- Remove CancellationToken as it's not possible to cancel
Issue #3842