- 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
- All three implementations updated to include an IsDisposed check which
will simply return immediately
- OffScreen updated to match the WinForms behaviour
- WPF is more complex because of the initialAddress and Address properties
initialAddress will be set if the browser hasn't been created, if the browserCreated
has been created and OnAfterBrowserCreated hasn't been called then we'll set the Address
dependency property.
NOTE: For WinForms/OffScreen there's a small window
here between CreateBrowser and OnAfterBrowserCreated
where the Address prop will be updated, though LoadUrl
won't be called.
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.
- ChromiumHostControl Add On OnVisibleChanged override
- ChromiumHostControl reorder OnSizeChanged so resize
happens before event for consistency
Follow up to #2922
* 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
- The Debug PDBs will now use SourceLink
- The C++/CLI projects will use SourceLink
- CefSharp.Core.dll now generates/uses a ref assembly
- The managed (c#) projects still embed sources/symbols for Release builds
At some point we should investigate generating a snupkg to reduce the dll size
As the browser is Disposed on a different Thread to OnAfterBrowserCreated is called there's possibility of an ObjectDisposedException.
Instead of locking just catch and ignore the error as it's extremely rare
Resolves#3437
- Add an UnWrap method to the interfaces (should be hidden from IntelliSense)
- For .Net 4.5.2 projects they're not a decorator class which an inner instance of the CefSharp.Core.Runtime Type
- For Net Core we have a ref assembly which allows us to reference the CefSharp.Core.Runtime without issues
We can potentially remove the ref assembly now and forgo any direct reference.
- When settings BrowserSettings/RequestContext properties the type checking needs to make sure the
CefSharp.Core.BrowserSettings and CefSharp.BrowserSettings objects are acceptable
- In WPF only the RequestContext was updated as there's no check for BrowserSettings property yet (probably should be)
https://github.com/cefsharp/CefSharp/issues/3343#issuecomment-757581368