Commit Graph

114 Commits

Author SHA1 Message Date
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 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 d87e795000 WinForms/Wpf/OffScreen - Create specific CefSettings class for each version
- This is a breaking change as there is no common `CefSharp.CefSettings`, there is no `CefSharp.Wpf.CefSettings`, `CefSharp.WinForms.CefSettings` and `CefSharp.OffScreen.CefSettings`
 - Cef.Initialize has been removed, the `ChromiumWebBrowser` constructor will call the `Cef.Initialize` with the defaults for your flavour
 - CefSettings.FocusedNodeChangedEnabled has been moved to CefSharpSettings.FocusedNodeChangedEnabled

Resolves #2477
2018-08-02 10:47:12 +10:00
amaitland 10a891548b WPF/OffScreen Example - Disable SurfaceSynchronization
https://bitbucket.org/chromiumembedded/cef/src/514ced40ceffa16966d9dee23a253014faf74d72/libcef/browser/osr/render_widget_host_view_osr.cc?at=3396&fileviewer=file-view-default#render_widget_host_view_osr.cc-243 (Apparently only relevant for 3396 branch)

See https://github.com/cefsharp/CefSharp/issues/2431
2018-06-27 20:42:53 +10:00
amaitland 3b6ff2fdbd WPF - Mouse Scroll becomes unresponsive
Add Hack to CefSharpApp to allow for setting of disable-features command line arg
Add the example command line args
https://github.com/cefsharp/CefSharp/issues/2408
2018-06-14 22:33:47 +10:00
amaitland e4535ab9df CefSharpSettings.SubprocessExitIfParentProcessClosed - only spawn task to monitor parent if command line arg present
Follow up to #2375
2018-06-11 22:18:51 +10:00
João Neves 5a713fdf7d Support uncaught exception handling (#2244)
* Added support for uncaught javascript exception in Render Process Message Handler
* Fixed typo
* Added stack frame column numbers
* Code review
* Code review
* Update JavascriptException.cs
2018-03-07 10:21:31 +10:00
amaitland fb374c0f94 CefExample - Add CefSharpSettings.Proxy example 2018-03-05 16:18:25 +10:00
amaitland 4b4e568f7d Add BindingTestSingle.html
Simple test page that can be used to test cases in isolation (useful for debugging purposes)
2018-03-05 14:02:59 +10:00
Alex Maitland 9b01b69d2f Implement Javascript Binding v2 (#2247)
* JSB Rewrite - Add CefSharp.RegisterBoundObject javascript method

To get around the problem of IPC timing, I've reversed the communication, now it's the render process requesting
the bound objects, the implementation is incomplete at this stage, more just a basic proof of concept

Rewrite BindingTest.html using QUnit
One of the tests doesn't map correctly as it requires def user interaction

TODO:

- Get objects by name
- Rename Messages.h values that relate to this change so they are more descriptive
- Better error handling
- Caching of objects within a render process
- Investigate global context options, don't think it's possible to call an async method directly in the global context

# Conflicts:
#	CefSharp.Example/Resources/BindingTest.html

* JSB Improve Request/Response message names

* BindingTest.html - Output stress test results

* Remove JavascriptRootObject was leftover from time we used WCF to transmit objects

* JavascriptObjectRepository - Objects are now sent in the same list with an IsAsync flag

Separation when sending over IPC with two unique lists isn't necessary

* JavascriptObjectRepository - Return objects by name or return all by default

Untabify CefAppUnmanagedWrapper.cpp
Add minor comment to CefBrowserWrapper for a reminder that we use Frame Identifier as dictionary key

* Add //TODO: JSB comments for work that's left to be done

Ideally within a render process we cache bound objects once they've been communicated,
It would also be nice to make multiple binding requests so objects can later be added dynamically

* JSB Allow multiple calls to CefSharp.RegisterBoundObject

Update BindingTest.html to name two distinct calls to different bound objects

* JSB - Add some notes about caching, no working implementation yet

* JSB - Dynamically Register object on Request

* JSB Add ability to unbind an object and rename RegisterBoundObject to BindObjectAsync

# Conflicts:
#	CefSharp.Example/Resources/BindingTest.html

* JSB BindObjectAsync - if objects already bound then return false

* JSB - Ignore Indexer properties

Were previously throwing an exception

* JSB - Add LegacyJavascriptBindingEnabled option so preserve existing behaviour

This is only useful for SPA application and those that only navigate to pages
hosting within a single domain. Any sort of cross-site navigation and a new
render process will be spawned and objects won't be bound automatically
(You can use the new methods to request they're bound yourself, at least in theory,
more testing required on this)

* Add LegacyBindingTest.html

Current disabled by default. To enable uncomment CefSharpSettings.LegacyJavascriptBindingEnabled = true;
in CefExample.cs

* RegisterJsObject and RegisterAsyncJsObject can now only be used when CefSharpSettings.LegacyJavascriptBindingEnabled = true

See https://github.com/cefsharp/CefSharp/issues/2246 for details
2018-01-22 10:24:25 +10:00
amaitland 6691d0080a Refactor ResourceHandler, split FileResourceHandler out into it's own class, rather than relaying on ResourceHandlerType - this allows us to add more underlying CEF type wrappers without a huge amount of effort now.
Add new ByteArrayResourceHandler - uses CefStreamReader::CreateForData to load the byte array, for use with CefStreamResourceHandler
Add ResourceHandler.FromByteArray method for ease of use
Change ResourceHandler.FromString to use the new ByteArrayResourceHandler class
2017-05-05 12:55:44 +10:00
amaitland 767b478dc6 Add Experimental option where bound async methods are queued on TaskScheduler.Default.
Set `CefSharpSettings.ConcurrentTaskExecution = true;` to enable this feature, should be set before the first ChromiumWebBrowser instance is created.
2017-05-04 12:53:48 +10:00
amaitland e5ecfde20f Upgrade version number to 57.0.0
Upgrade to cef.redist.x86.3.2987.1591
CefSchemeRegistrar::AddCustomScheme has new params - IsSecure and IsCorsEnabled
Also new CefRawPtr type is used for Scheme registra
2017-03-13 10:58:03 +10:00
amaitland 04ff93817e Add https://pixabay.com/en/beach-pacific-coastline-ocean-coast-2089936/ to CefSharp.Example as embedded resource - test loading of image using browser.RegisterResourceHandler 2017-03-06 08:57:11 +10:00
amaitland 760d81dc23 Change PostDataAjaxTest.html to use https scheme and add CrossOriginWhilstList entry (AJAX post data for custom schemes stopped working ages ago, this just works around the problem). 2017-03-06 08:55:08 +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 ee5fd34ee6 Comment out Cef example - none of the CefSharp examples have the relevant directory present.
Update xml comments on Cef.RegisterWidevineCdm
Add braces to if check - even single line if statements have braces for consistency
2017-02-13 15:55:44 +10:00
Justin Stenning 2298ea0a93 Implementation of Cef.RegisterWidevineCdm (#1935)
* Added Cef.RegisterWidevineCdm for CEF Widevine CDM registration #1934
* Added test page for WidevineCdm registration and example registration #1934
* Noted additional steps for Widevine and proprietary codecs to CdmSupportTest.html
* Link for more information changed to issue #1934 in CefExample.cs
* replaced Cef.RegisterCdmCallback's async result with IRegisterCdmCallback parameter
* RegisterCdmCallback now uses taskCompletionSource
2017-02-13 15:37:55 +10:00
amaitland 2b4840fc90 Add CssAnimation example for testing purposes 2017-02-01 09:37:08 +10:00
amaitland 895932d05e Remove EnableInternalPdfViewerOffScreen() as disable-surfaces has been removed from Chromium.
This leaves the original https://bitbucket.org/chromiumembedded/cef/issues/1689 issue as being a problem, for now just disable GPU acceleration

Conversation about disable surfaces is http://magpcss.org/ceforum/viewtopic.php?f=6&t=14520&p=32346#p32345
2016-09-23 09:16:05 +10:00
amaitland 9fbde82ef0 Experimental implementation of IBrowserProcessHandler.OnScheduleMessagePumpWork
NOT READY FOR PRODUCTION USE
2016-09-01 16:51:20 +10:00
amaitland a8ef40fe8a Add command line option to test #1634 2016-08-20 08:24:12 +10:00
amaitland 63ef6beb5f Refactor OnContextInitialized out as part of IBrowserProcessHandler interface
Add OnScheduleMessagePumpWork for use with integrating into existing message loop - probably better for WinForms integration, will look at providing an example later
2016-07-20 13:08:47 +10:00
amaitland 6f6ecd3090 Add TooltipTestUrl to WPF Example menu 2016-06-29 12:05:19 +10:00
amaitland ca2085ef05 Add FolderSchemeHandlerFactory - maps request urls to files on disk within a specified folder.
Resolve #1717
2016-06-22 12:23:50 +10:00
amaitland ec0a10095c Disable GPU for windows 7 as it appears to still be a problem with #1634 2016-06-16 08:05:21 +10:00
amaitland 0a5bb1f837 Re-enable GPU in OffScreen and WPF examples 2016-05-30 08:09:18 +10:00
amaitland 1e18b55116 Comment out the enable-begin-frame-scheduling command line flag from OSR examples - DevTools wasn't working 2016-04-19 15:06:11 +10:00
amaitland e2a690dca9 Change PluginVisitor to set the TaskCompletionSource to an empty list when Visit is never called
Slightly nicer behaviour than timing out
Update the example
2016-04-15 15:44:35 +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 c90d67c14d Add enable-logging command line argument example 2016-04-11 07:52:11 +10:00
amaitland c3f3331148 Add InMemorySchemeAndResourceHandlerFactory to demo how easy it is to implement a IResourceHandlerFactory/ISchemeHandlerFactory
Both implementations are included in the single file so it's easy to compare the two, the implementation is almost identical for the method body.
2016-03-29 13:04:06 +10:00
amaitland b1b38ac62c Disable GPU in WPF and Offscreen examples until #1634 has been resolved 2016-03-21 06:46:20 +10:00
amaitland 599ad179fb Update OnContextInitialized example to dispose of requestcontext via a using statement 2016-03-19 07:32:47 +10:00
amaitland f18fe9d4ae Add Cef.CurrentlyOnThread method for checking if your on a particular CEF thread
Add Cef.GetGlobalRequestContext, can be used to set preferences and other related features
Update IRequestContext.SetPreference documentation, preferences set via the command line are read only
2016-03-19 07:30:03 +10:00
amaitland 651a288a8f Add example of --allow-running-insecure-content (only valid in 47 and above) 2016-03-06 22:28:27 +10:00
amaitland f238b2bf50 Add Filter test url to WPF Example 2016-02-11 11:33:44 +10:00
amaitland 96e5900558 Add example of how to disable extensions
Add example of how to disable internal PDF viewer
2016-01-29 18:15:11 +10:00
amaitland bae3c28e92 Update copyright to 2016 2016-01-11 14:11:30 +10:00
Alex Maitland c57d69b6be Merge pull request #1531 from rlmcneary2/rename-enable-focus
Rename EnableFocusedNodeChanged to FocusedNodeChangedEnabled
2016-01-06 11:17:53 +10:00
Rich McNeary a27a097df6 Change from EnableFocusedNodeChanged to FocusedNodeChangedEnabled to match the existing WindowlessRenderingEnabled setting property. 2016-01-05 07:30:23 -05:00
amaitland 6abfe427b1 Add demo that loads the pepper flash plugin that comes with Google Chrome 2015-12-29 11:07:04 +10:00
Rich McNeary 7d4e074ef4 Move OnFocusedNodeChanged into new IRenderProcessMessageHandler. 2015-12-08 09:32:54 -05:00
Rich McNeary 443804084e Changed to specifically request FocusNodeChanged messages. 2015-12-08 09:04:22 -05:00
Rich McNeary 1fb54241f7 Add the OptionalMessages property to CefSettings. 2015-12-07 16:27:17 -05:00
amaitland fe11f2eada Add Cef.DoMessageLoopWork example to WinForms.Example project 2015-10-21 19:56:45 +10:00
amaitland 190178e79e Only enable WCF if a bound object has been registered
Fixes #1272
2015-09-18 13:56:43 +10:00
amaitland 3fac742403 Demo Post data for #1267 2015-09-16 16:01:48 +10:00
Alex Maitland 3ba9dc914d Merge pull request #1268 from amaitland/fix/schemeregistration
Register Custom Schemes in all sub processes
2015-09-16 09:06:41 +10:00
amaitland 561b50b2cd Register the same scheme twice to confirm parsing of command line arguments
Fix up some urls in the custom scheme popup test
Add PopupTest.html to WPF example menu
2015-09-16 09:05:52 +10:00