Commit Graph

2231 Commits

Author SHA1 Message Date
Chris 1097b7c7c7 Fixed spelling error in IJavascriptObjectRepository (#2702) 2019-03-22 20:12:24 +01:00
Chris 86b2d8cecd Improved dispose pattern in ChromiumWebBrowser (#2651)
* Code Cleanup - Improved ChromiumWebBrowser Dispose/Finalise

* Added thread safe dispose pattern
* Added IsDisposed

* Wpf - Cleanup and improvements to the dispose pattern

* WinForms - Cleanup and improvements to the dispose pattern

* OffScreen - Cleanup and improvements to the dispose pattern

* Added IsDisposed to IWebBrowser

* Fixed comments

* WinForms - Removed Finalizer and Dispose()

* WPF - ChromiumWebBrowser.Dispose add comment for Interlocked.CompareExchange

* WinForms - ChromiumWebBrowser.Dispose add comment for Interlocked.CompareExchange
2019-03-22 21:49:02 +10:00
amaitland 988c8ca263 IBrowserHost - Add SetAudioMuted and IsAudioMuted
Resolves #2665
2019-03-21 21:26:17 +10:00
amaitland 3423670740 WinForms/WPF/OffScreen - Dispose of BrowserSettings only if created by CefSharp framework
- Add OffScreen project to internals visible to list for CefSharp.Core
- Add BrowserSettings.FrameworkCreated property which can only be set through an internal constructor
- Dispose of BrowserSettings immediately after call to CreateBrowser if created by CefSharp framework
- managedCefBrowserAdapter::CreateBrowser  throw exception if browserSettings already disposed

Resolves #2643
2019-03-21 20:13:02 +10:00
amaitland fbe9c556e2 Core - Add LogSeverity.Fatal
Resolves #2639
2019-03-21 13:33:50 +10:00
Alex Maitland 70de3a6d9c Add Initial IRenderProcessHandler.OnContextCreated/Released implementation (#2697)
* WinForms/WPF - Dispose of IFrame after calling LoadUrl

* BrowserProcess - Add initial implementation of IRenderProcessHandler.OnContextCreated/OnContextReleased

- IV8Context.Execute is the only method to be implemented so far (execute script without returning a result)
- Wrappers for CefFrame and CefBrowser have yet to be imported yet, still need to determine if they should be included individually or reference to CefSharp.Core added

* BrowserProcess - Add wrappers for Browser and Frame

Ultimately we should probably remove the CefSharp.BrowserSubprocess.Core project and move all the code into a folder/namespace within CefSharp.Core
This would allow us to share the a lot of existing code, major refactor required

* CefSharp.Common.props - Add CefSharpBrowserProcessCore32/64 properties

Make creating your own custom browser process easier

* BrowserProcess - Remove example and add comments about creating your own custom version
2019-03-20 20:33:10 +10:00
amaitland 8ffd29fc56 Upgrade version numbers to 73.0.0 2019-03-15 22:13:07 +10:00
amaitland 679250ee58 Upgrade version number to 72.0.0 2019-02-25 21:54:25 +10:00
Chris a9b3c36f77 Build.ps1 - Automated more tasks relating to updating CefSharp version and copyright year (#2640)
* build.ps1 - Write version to CefSharp.shfbproj

* build.ps1 - Specify UTF-8 as encoding when reading

* build.ps1 - Save files as UTF-8 without BOM

* build.ps1 - Update copyright year on compiled files

* build.ps1 - Update version in appveyor.yml

* Removed copyright year from the nuspec files

* Updated editorconfig for ps1 files

* Apply changes from build.ps1

* LICENSE - Removed year
2019-02-15 21:40:25 +01:00
amaitland 6f6ca94ea9 WPF Example - Change to using DataUri (LoadHtml extension method) for showing errors instead of LoadString
- Add new IFrame.LoadHtml extension method.

Related `upstream` issue is https://bitbucket.org/chromiumembedded/cef/issues/2586/loadstring-results-in-terminating-renderer
2019-02-08 10:42:15 +10:00
amaitland 2c9155f1cb WinForms/WPF - Change browserSettings to use the private field to avoid throw exception in dispose
- Changed to expose only the public interface (this is better for scenarios where the designer attempts to query the property and subsequently attempts to load libcef and fails).
- Make IBrowserSettings implement IDisposable
- ManagedCefBrowserAdapter::CreateBrowser now throws exception if browserSettings param is null

The WPF version won't actually throw an exception, just standardised it's code so they're both the same.

Issue #2638
2019-02-08 10:14:32 +10:00
amaitland da06d3786e Add LegacyResourceHandlerFactory - for backwards compatibility with old behaviour. 2019-01-22 15:25:19 +10:00
amaitland 73d6a06284 RequestContext - Fix some xml doc mistakes 2019-01-17 05:36:35 +10:00
amaitland 2706f13b1a DependencyChecker - Switch to using Uri.TryCreate as is more fault tolerant 2019-01-15 12:14:29 +10:00
campersau b31069633e add spaces in exception messages (#2620) 2019-01-11 08:57:28 +10:00
amaitland 05b640532f Xml doc improvements/fixes 2019-01-09 20:27:06 +10:00
amaitland a340ebd922 OffScreen - BrowserSettings throw exception if attempting to use Disposed instance 2019-01-09 17:26:39 +10:00
amaitland 2b905c1d01 BrowserSettings - Add command line arg xml doc comment to Javascript property 2019-01-09 14:39:24 +10:00
amaitland f9cc0affb6 LoadExtension - Add additional comments about loading crx files
They must be unzipped first.
2019-01-09 07:23:28 +10:00
Alex Maitland ce38ed81f0 Add IApp interface and DefaultApp implementation (#2616)
* Core - Add IApp interface and DefaultApp implementation

Move code from Cef.Initialize into CefSharpApp

Working towards #2139

* CefSharpApp.h - Allow CefCustomScheme->SchemeHandlerFactory to be null

If cefCustomScheme->SchemeHandlerFactory is null then we no longer attempt to call CefRegisterSchemeHandlerFactory
You can then choose which RequestContext you wish to register your handler for, no longer forcing you to register
in the global context

Remove null checks in OnScheduleMessagePumpWork as we're throwing an exception if they're null when the CefApp is created
2019-01-09 05:57:57 +10:00
Alex Maitland 02e3084af3 Add Chromium Extension Support (#2613)
* Add Chromium Extension Support

Add IRequestContext.LoadExtension
Add IExtensionHandler
Add IExtension
Add example (import from cefclient) - was added to CefSharp.WinForms.Example projct
Add RequestContextExtensions - to make loading an extension slightly easier
2018-12-31 13:12:10 +10:00
amaitland 809a7859b6 Update version numbers to 71.0.0 2018-12-28 13:52:03 +10:00
amaitland 2612c68002 Add IBrowserHost.RunFileDialog
Demo added to WinForms project

Resolves #2594
2018-12-28 13:39:33 +10:00
amaitland 416c4d7f9f DependencyChecker.AssertAllDependenciesPresent - Update how base path calculated
If browserSubProcessPath is an absolute Uri then use the folder as the base path
otherwise use the old behaviour and use the executing assembly

Resolves #2603
2018-12-27 21:56:44 +10:00
amaitland 9c742e0aac IBrowserHost.ImeSetComposition/ImeCommitText - Add ReplacementRange
IBrowserHost.ImeCommitText - Add relativeCursorPos

The CEF doc https://magpcss.org/ceforum/apidocs3/projects/(default)/CefBrowserHost.html says they should be optional params and only required on Mac OSX
Reports suggest they are required.

Resolves #2599
2018-12-27 21:14:36 +10:00
amaitland 11a8371e19 Rename CefExtension to V8Extension
Resolves #2612
2018-12-27 15:47:29 +10:00
amaitland c7501cd5a3 IResponse - Remove ResponseHeaders
Was marked as Obsolate, has been replaced by Headers property

Resolves #2607
2018-12-16 21:53:11 +10:00
amaitland bbf7795d80 WPF/OffScreen - Add OnAcceleratedPaint
Exposes the CEF API for Shared D3D11 Texture support. This should be considered experimental as there are quite a few known bugs in the CEF implementation
(PDF Viewer not working correctly)

OffScreen.ChromiumWebBrowser.CreateBrowser API changed (breaking change) now pass in `WindowInfo` to customise settings
Refactor CreateBrowser to support windowed and OSR rendering (now accepts IWindowInfo)

Resolves #2527
2018-12-16 19:37:12 +10:00
amaitland c618dc155b RenderClientAdapter.h - GetViewRect must return a CefRect
CEF API Change see https://bitbucket.org/chromiumembedded/cef/commits/09afa3a843531a1768896bed3f64fb49ed81b525?at=3578
2018-12-16 10:48:52 +10:00
Alex Sukhovy 304a300b0c Call OnContextCreated and OnContextReleased for each frame (#2373)
* ContextEvents for each frame

* set CanExecuteJavascriptOnMainFrame

* example and comments

* whitespace fix

* comments

* whitespace

* update comments
2018-10-28 16:48:50 +10:00
amaitland 436bd9c72d CefTerminationStatus - Add OutOfMemory value
https://bitbucket.org/chromiumembedded/cef/commits/391685c2795d0e9698df4d7bd05fa4692acf5ba9?at=3538

Resolves #2551
2018-10-28 10:58:30 +10:00
amaitland ce93352345 Upgrade version numbers to 70.0.0 2018-10-28 10:53:26 +10:00
amaitland bc2693e76d CefSharpSettings.SubprocessExitIfParentProcessClosed - default to true
This will land in the 71 release, changing the default to true
Can easily be overridden by setting to false before calling Cef.Intialize (if your not explicily calling Cef.Initialize then before creating your first ChromiumWebBrowser instance)
2018-10-26 13:23:45 +10:00
amaitland 5396f70232 WebBrowserExtensions.LoadUrlWithPostData - Update xml doc comment
Follow up to #2451
2018-10-17 07:07:52 +10:00
Igor e81eb2e217 FolderSchemeHandlerFactory - change resource file share mode. (#2535)
* FolderSchemeHandlerFactory - change resource file share mode to ReadWrite.

* FolderSchemeHandlerFactory - add FileShare to controller parameters; make fields readonly.
2018-10-13 12:10:38 +10:00
Chris cde90a34b9 WebBrowserExtensions::GetScript - Added support for all numerical types (#2526)
* WebBrowserExtensions::GetScript - Added support for all numerical types

* Removed leftover using
2018-09-29 16:11:38 +10:00
amaitland 63a569c807 WebBrowserExtensions - Add ExecuteScriptAsyncWhenPageLoaded
Extensions method that attempts to execute javascript immediately if the page is loaded or wire up the LoadingStateChanged
event handler.
2018-09-28 14:15:43 +10:00
amaitland 1b39c2a70a WinForms/WPF/OffScreen - Cleanup some xml doc around BrowserInitialized event
Probably still needs some work, would be nice if the event was the same in all three instances, difficult with the WPF version being a DependencyPropertyChangedEventHandler
2018-09-27 22:02:00 +10:00
amaitland 246dad90a1 WebBrowserExtensions - Fix naming private static variable naming
.editorconfig consistency
2018-09-27 17:24:21 +10:00
amaitland dcff3d0094 IJsDialogHandler - Rename OnJSBeforeUnload to OnBeforeUnloadDialog
Also fix xml doc

Resolves #2523
2018-09-25 20:56:31 +10:00
Chris 30ee538ce0 Added EditorConfig (#2514) 2018-09-17 00:46:21 +02:00
amaitland 6602977496 Upgrade version number to 69 2018-09-10 13:27:10 +10: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 8ed2681619 Xml Doc - Add some more xml doc
Some of it's just placeholder doc to keep sandcastle happy
2018-09-05 13:01:41 +10:00
Igor 0ede12e7ba Add OSR AccessiblityHandler. (#2480)
* Add AccessibilityHander.

Implement CefAccessibilityHandler. Add IAccessibilityHandler interface. Add AccessibilityHandler field to IWebBrowser.

* Pull request fixes.

Replaces tabs with spaces; move CefAccessibilityHandler implementation to RenderClientAdapter; add missing comments.

* Add CefValueWrapper.

Add ICefValue interface; pass ICefValue to IAccessibilityHandler.

* Pull request fixes.

Rename CefValue to Value and CefValueType to ValueType; add CefValueWrapper::GetObject() method; remove stub code in AccessibilityHandler; fix comment on IAccessibilityHandler.

* Pull request fixes.

Fix comments for IValue; remove redundant global namespace reference for CefValueType.
2018-08-16 19:33:02 +10:00
amaitland 14daf0a746 FrameLoadStartEventArgs/FrameLoadEndEventArgs - Only set Url param if frame.IsValid
Should resolve #2486
2018-08-16 11:54:21 +10:00
amaitland f6088f33d2 DefaultResourceHandlerFactory - Rewrite so it stores byte[] instead of storing IResourceHandler
It's not actually a factory and will handle multiple requests to the same url

Only API change is for DefaultResourceHandlerFactory directly, the LoadHtml and RegisterResourceHandler extension methods
stay unchanged
2018-08-13 12:39:04 +10:00
amaitland d14c26a892 IResponse.ResponseHeaders - Make obsolete
Use IResponse.Headers instead
2018-08-07 19:33:51 +10:00
amaitland e5a7ed75ec Upgrade version numbers to 68.0.0 2018-08-07 19:15:00 +10:00
amaitland a9f249e835 ClientAdapter::OnSetFocus - When DevTools is opened, OnSetFocus is called before OnAfterCreated
The causes GetBrowserWrapper to return null when DevTools is opened, for now we'll just create the wrapper
and pass it directly (wrapper is disposed when it goes out of scope).
2018-08-07 19:10:58 +10:00