Commit Graph

107 Commits

Author SHA1 Message Date
Alex Maitland 3f7c5c8e94 Core - Add IDownloadHandler.CanDownload
- Add IDownloadHandler.CanDownload
- Add to Fluent implementation
- Update examples

https://bitbucket.org/chromiumembedded/cef/commits/6d7a6801871cd4fcceb174dfa99a5b46da6253c1

Resolves #4090
2022-05-05 12:37:44 +10:00
Alex Maitland 91799184db Core - Add IChromiumWebBrowserBase.GetRequestContext extension method
Simplifies getting the RequestContext for a ChromiumWebBrowser instance
2022-05-04 10:52:53 +10:00
Alex Maitland 4060917f36 WinForms Example - Add Hide Scrollbars menu item
- Use DevTools to hide scrollbars
2022-03-07 13:18:42 +10:00
Alex Maitland 597e54fc11 IBrowserHost.Find remove identifier param
Resolves #4013
2022-02-22 11:17:56 +10:00
Alex Maitland 12d28b6c02 WinForms - Add new IWinFormsChromiumWebBrowser interface
- Common interface of ChromiumHostControl and ChromiumWebBrowser
- WinForms Example Fix removing of Tab
2022-01-31 12:54:18 +10:00
Alex Maitland 01b7a4330e 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:44:30 +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 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 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
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
Alex Maitland 129879cd20 WinForms - Add LifeSpanHandler.OnPopupBrowserCreated
- Add new fluent method to the WinForms specific LifeSpanHandler
- Allows simply access to the IBrowser
2021-11-25 10:00:37 +10:00
Alex Maitland 7f870db945 Core - FrameHandler track frame lifecycle
- FrameHandler now tracks frame creation and removal and reuses the IFrame reference
- CefFrameWrapper no longer throws exception if accessing Identifier for invalid frame, this appears
to be a valid use case now which makes sense otherwise we'd never be able to identify the frame.

Resolves #3588
2021-09-10 14:32:04 +10:00
ValentinNikin d0bdc735eb Updated example for Audio Handler (#3724)
* Implemented example for Audio Handler

* Rename AudioHandlerExample to AudioHandler

* Allow unsafe code

* Remove UnmanagedMemoryStream using

* Fix problem with build

* Allow unsafe code for .NET Core project

* Remove excess PropertyGroup

Co-authored-by: Valentin Nikin <nikin.v@tecomgroup.ru>
2021-07-31 06:30:59 +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
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 e1b0d07c17 WinForms - Add ChromiumRenderWidgetHandleFinder/ChromiumWidgetNativeWindow
Used to hook the low level HWND and get message (e.g. mouse messages)

Updated the example
2021-05-11 20:39:57 +10:00
amaitland e8cf336bf3 Net Core - Support for compiling with .Net Core 3.1
- Make Wpf/WinForms/OffScreen projects target AnyCPU
Only the VC++ projects are platform specific now.
- Remove BrowserSubProcess project reference
Not needed as we now have a standalone exe
- Add OffScreen example
- Add WPF Example project
- Fix some compile errors for main solution
- Add BrowserSubProcess executable
- JavascriptObjectRepository remove isAsync param
Rather than throw exception remove the option
- BrowserSubprocess Exclude the WCF specific code from the netCore project
- Add some ifdef/ifndef to exclude the WCF specific implementation
- Move WCF implementation into separate namespace
2020-07-23 15:23:45 +10:00
Konstantin Preißer 5e89f71a44 Add new projects targeting .NET Core 3.1 (#3181)
* Add .NET Core 3.1 projects for CefSharp, CefSharp.Core, CefSharp.BrowserSubprocess.Core, CefSharp.WinForms, CefSharp.Wpf, CefSharp.OffScreen.

Contributes to CefSharp#2796

* - Remove dependencies to "opengl32.lib" and "glu32.lib" which aren't available for ARM64 and don't seem to be needed.
- Clean up project files.

* Switch project CefSharp.netcore.csproj to AnyCPU as it doesn't require different builds for each platform.

* Remove WindowsTargetPlatformVersion property as that is declared in CefSharp.props.

* Use "bin.netcore" and "obj.netcore" as [intermediate] output path for the .NET Core projects, to allow side-by-side builds with the .NET Framework projects.

* Output documentation files.

* Add CefSharp.Example.netcore and CefSharp.WinForms.Example.netcore.

* Follow-up: Remove properties from the example projects that are also not used in the corresponding .NET Framework projects.
2020-07-23 15:21:14 +10:00
Alex Maitland 8d25b71490 Core - Re-Add IAudioHandler (#3153)
Resolves #3152
2020-07-08 08:06:16 +10:00
campersau 3b89e27884 WinForms Example - Use Uri.EscapeDataString instead of WebUtility.HtmlEncode for escaping query string value (#3162) 2020-06-30 20:57:24 +10:00
amaitland 253849549b WinForms Example - Use google.com as search engine when invalid url entered in address
If Uri.IsWellFormedUriString is false then we'll load using https://www.google.com/search?q=
2020-06-30 14:28:13 +10:00
amaitland ca2837f928 WinForms - Make ControlExtensions.InvokeOnUiThreadIfRequired internal
- Additional check is control is being Disposed
- Add copy and paste version of ControlExtensions.InvokeOnUiThreadIfRequired to example project

Resolves #2983
2019-12-02 20:37:41 +10:00
amaitland 1d2fb9531f WinForms Example - Add ChromiumContainerControl to host docked DevTools
Required for arrow/tab key presses to be forwarded correctly to DevTools
Only required when CefSettings.MultiThreadedMessageLoop = false
2019-09-10 19:41:21 +10:00
amaitland 7980c30478 WinForms Example - Minor changes to DevTools docked example
- Add/revise comments
- Rename some variables

Follow up to #2804
2019-08-14 11:11:10 +10:00
Luke 1992e4970c WinForms - Add example of how to dock devtools into the same window. (#2804)
* Add a SplitContainer as the base UI panel and place the browserPanel in Panel1 and new devToolsPanel in Panel2.
Create two new public methods to open and close the devtools.

* BrowserForm - Changed the Show/Close devtools to call the new methods in the BrowserTabUserControl. If the LifeHandler is null, normal behaviour is assumed.

* Handle the DoClose event in LifeSpanHandler if the IBrowserHost.CloseDevTools() is called directly. This is more of a fail-safe, if the normal CEF behaviour is allowed then entire application will close.

* Added some addtional comments.

* Uncomment the instantiation of the LifeSpanHandler

* Removed devToolsPanel from designer
Removed CloseDevToolsDocked() method
Made ShowDevToolsDocked() method easier to copy and paste
Closing Devtools should now be handled in LifeSpanHandler.DoClose()
Added a bool to the LifeSpanHandler constructor whether to handle Browser popups.
Added Toolscript menu item to show DevTools Docked or Popup
Added async Method to check it DevTools is open

* Changed field access modifier to private

* Renamed dispose devtools handler with a more meaningful name
2019-08-14 10:16:21 +10:00
amaitland 4183b464d1 WPF/WinForms Example - Allow mailto to trigger OnProtocolExecution
- When Url starts with mailto then use our ExampleResourceRequestHandler
- Ignore unknown scheme errors when it's mailto, we expect that it's unknown
- WPF Example remove duplicate OnLoadError in BrowserTabViewModel
2019-07-10 20:47:55 +10:00
amaitland c7b9d07008 BrowserTabUserControl - Mark DllImport as private 2019-04-16 15:16:58 +10:00
Chris e22d1c2fd2 Removed IsBrowserInitializedChangedEventArgs (#2710) 2019-04-10 19:51:34 +10:00
Alex Maitland 574bc16db2 BrowserTabUserControl - Add xml doc to SetupMessageInterceptor 2019-02-28 15:16:08 +10:00
merceyz 3eee0d6787 WinForms.Example - Fixed message interceptor not working after a render process switch 2019-02-17 20:24:27 +01:00
amaitland 4f71295941 CefSharp.Example - Move example classes into handlers/javascriptbinding folders/namespaces
Basic code cleanup
2018-10-29 16:21:42 +10:00
Chris 30ee538ce0 Added EditorConfig (#2514) 2018-09-17 00:46:21 +02:00
Chris bef5dd37c4 Maintenance - Fixed formatting, file encoding, and copyright year (#2504)
* Applied formatting

* Fixed file encoding + Updated copyright year

* Updated License

* Fixed more file encoding

* Copyright notice now shows the year the file was created
2018-09-10 10:41:13 +10:00
amaitland 1107a1a894 WinForms Example - Set FocusHandler to null when multiThreadedMessageLoopEnabled = false
It's not required when multiThreadedMessageLoopEnabled = false and can interfere with
the system onscreen keyboard used by touch screen.
2018-07-23 21:18:44 +10:00
amaitland c37dbcd06a Remove Geolocation API and Upgrade version numbers to 65 2018-03-17 21:31:25 +10:00
amaitland fbce2d61de WinForms Example - Update LifeSpanHandler example to host popup in Tab (notify popup of move and resize) 2018-01-30 15:01:38 +10:00
amaitland 3334d71fc4 WinForms Example - Add binder to registered objects
Required to run BindingTest.html
2018-01-24 10:03:26 +10:00
amaitland 44b7600600 WinForms Example - Add additional JS binding 2018-01-23 21:35:23 +10:00
amaitland 679cdb5b11 JSB ResolveObject WcfEnabled = false throw exception if attempt to register sync object
Update the examples to use newer Register method as Legacy options is disabled by default
2018-01-22 11:02:23 +10:00
amaitland 6a437710b6 WinForms example use args.IsLoading rather than !args.CanReload 2017-03-06 08:55:07 +10:00
Chris cd934267c6 Updated copyright year and made sure it used same format everywhere (#1966) 2017-03-06 08:44:37 +10:00
amaitland 81366fc11f Only set keyboard handler in Winforms example of using multiThreadedMessageLoopEnabled 2016-10-04 13:55:05 +10:00
amaitland 3f70d10538 Only hook into the Chromium message loop if we're using multiThreadedMessageLoop - no need if they're running in the same thread 2016-09-08 08:53:28 +10:00
Alex Maitland d4feffb554 Feature - Add IBinder (#1749)
* Add basic ModelBinding which was imported from NancyFx framework - more can be stripped out that's unused

* Add IBinder as a param when registering an object for binding
Binding is disabled by default

* Add license and remove unused using statements

* Make bind method virtual to allow for overriding
Make methods protected

* Add very basic collection support - only primitive types supported for now.
Remove unused exceptions

* Support binding a list of sub objects

* Add null check for null params

* Add BindingOptions class - remove binder and CamelCaseJavascriptNames properties - allow for additional options in the future
Breaking change.

* Add support for List<object> binding type
2016-07-20 13:38:24 +10:00
amaitland 04885eb6d5 Add webkit.webprefs.minimum_font_size example, see that preferences are being set correctly 2016-06-13 19:07:26 +10:00
amaitland 509ab98b05 Add example of disable spell checking through preferences 2016-04-20 07:45:54 +10:00
amaitland 4c4eb210f4 Add WPF Draggable Regions Test
Remove old generic DragHandler - maybe someone will write a WinForms specific one?
Remove some unused references from CefSharp.csproj
2016-04-12 16:57:47 +10:00
amaitland 38254a59d5 Rewrite ChromeWidgetHandleFinder to use a GCHandle - much cleaner method of interfacing with dllimport 2016-04-11 07:52:10 +10:00
amaitland 7f1f1c5f21 Add example IDisplayHandler.OnFullscreenModeChange to WinForms example - reparent ChromiumWebBrowser control to demo switching to fullscreen, little bit of screen resize which isn't perfect, it works ok though. 2016-03-30 10:58:05 +10:00
amaitland dd7ea823a3 Add PopupFeatures and BrowserSettings to OnBeforePopup
Update WinForms popup example - comment out experimental feature

Had to add interfaces to allow for wrapping of the structures (BrowserSettings and PopupFeatures)

Resolves #1586
2016-03-07 18:58:56 +10:00