Commit Graph

85 Commits

Author SHA1 Message Date
Alex Maitland 91a2786b42 Add IAudioHandler (#2727)
* Feature Request - Add IAudioHandler

- For performance reasons we return NULL if no audiohandler is assigned
- No example is provided currently

Initial implementation for #2714
2019-05-03 21:05:26 +10:00
João Neves 6692749728 WPF - Implement UpdateDragCursor (#2691)
* Close cefsharp subprocess if main process dies

* Implemented UpdateDragCursor

* Fixed braces position

* Added license header

* Fixed cursor flickering

* Added test

* Fixed build

* Fixed move cursor

* Fixed braces

* Simplified solution

* Fixed dropping Link effect

* Fixed encoding + Removed leftovers
2019-04-05 11:58:27 +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 2612c68002 Add IBrowserHost.RunFileDialog
Demo added to WinForms project

Resolves #2594
2018-12-28 13:39:33 +10:00
amaitland 4f71295941 CefSharp.Example - Move example classes into handlers/javascriptbinding folders/namespaces
Basic code cleanup
2018-10-29 16:21:42 +10:00
amaitland cfb0db1c3f RequestEventHandler - Add CanGetCookies and CanSetCookie 2018-03-28 14:40:26 +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 e27c9c3c21 Add ExperimentalStreamResponseFilter - buffers all data before performing text processing 2018-01-18 10:25:52 +10:00
amaitland c303e1ca0f JSB - Add support for async methods to return classes
Structs and classes can now be returned from an async method
Properties and fields are supported now. The returned class/struct is readonly effectively, no updates will be sent to the bound object.

Just to clarify this is only for objects bound using RegisterAsyncJsObject
2018-01-08 15:12:52 +10:00
amaitland 464dd14b6f Update Example RequestHandler to inherit from DefaultRequestHandler
A new default implementation was added in #2157
BrowserTabView - cleanup usings and remove unused code
2017-12-20 10:01:34 +10:00
amaitland f5e2a938ec Follow up to #2015
Add license disclaimer
Move example MethodInterceptorLogger into CefSharp.Example project
Reword the IMethodInterceptor xml doc a little bit, probably still needs some work
2017-06-01 11:32:06 +10:00
amaitland 504d04dc43 Include FindReplaceMultiResponseFilter in example project, update it's copyright year and tweak it's formatting 2017-05-08 16:02:46 +10:00
amaitland 2cb7753b0b Add MemoryStreamResponseFilter example - data is copied into a memoryStream which can be read in IRequestHandler.OnResourceLoadComplete 2017-05-08 15:57:51 +10:00
amaitland 0067d02360 Add UnicodeExamples one equal to 32kb (the default buffer size) and one slightly greater.
Change CefSharpSchemeHandlerFactory to always include a BOM (premable) to the front of the response data
2017-05-05 13:06:26 +10:00
amaitland 6ded700373 Add Recaptcha test - https://cefsharp.com/Recaptcha.html 2017-03-30 07:55:47 +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
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
Florian Obermayer ee563827ac Request event handler (#1918)
* Create RequestEventArgs.cs

* Create RequestEventHandler

* Update RequestEventArgs.cs

corrected namespace

* removed regions, splitted up classes per file

* reformatted code

* removed wrong class doc

* deleted empty line

* removed TODOs (moved them in pr comments)

* adapted @amaitland 's pr notes

* made code backwards compatible to c# < 6

* made code backwards compatible to c# < 6 ++ (moved default values for event args to ctor)

* made code backwards compatible to c# < 6 ++ (added private setters to properties)
2017-02-10 09:24:27 +10:00
amaitland 2b4840fc90 Add CssAnimation example for testing purposes 2017-02-01 09:37:08 +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 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 c8f6017fa5 Change TestCallbackFromObject to use new DynamicDictionary helper class 2016-07-06 11:06:00 +10:00
amaitland 54f7fccdaa Upgrade to .Net 4.5.2
Resolve #1572
2016-05-10 20:28:21 +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 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 679fad6a89 Add AppendResponseFilter filter implementation
In the examples open custom://cefsharp/assets/js/application.js to see some data appended to a javascript file
2016-02-11 16:33:52 +10:00
amaitland ede3370cfd Roughly port FindReplaceResponseFilter - compiles, not yet functional
https://bitbucket.org/chromiumembedded/cef/src/456ea5a19800a4cc05d0ce7f0c38111a7e73e18b/tests/cefclient/browser/response_filter_test.cc?fileviewer=file-view-default#response_filter_test.cc-31
2016-02-11 11:18:00 +10:00
amaitland 940a55a521 Rename to PassThruResponseFilter
Add example html file from https://bitbucket.org/chromiumembedded/cef/raw/456ea5a19800a4cc05d0ce7f0c38111a7e73e18b/tests/cefclient/resources/response_filter.html
2016-02-11 10:47:15 +10:00
amaitland 59edbf9ca5 Move filter into it's own folder 2016-02-11 10:44:29 +10:00
amaitland 8d00a3dd26 Add a rough implementation of IRequestHandler.GetResourceResponseFilter
Looks like the basic pass through implementation is working - have yet to append any data
2016-02-11 10:40:11 +10:00
amaitland 072ca4cc97 Add IResourceHandlerFactory and IResourceHandler example - downloads a specific swf file using the .Net WebRequest class and returns the response 2016-01-18 18:32:44 +10:00
Rich McNeary a168cadbad Add javascript syntax highlighting. Include demo page. 2015-12-28 14:28:15 -05:00
Rich McNeary 5691669df3 Initial script examples. 2015-12-14 14:54:04 -05:00
Rich McNeary 7d4e074ef4 Move OnFocusedNodeChanged into new IRenderProcessMessageHandler. 2015-12-08 09:32:54 -05:00
amaitland c00eeb82f5 Remove some stray AnyCPU targets from the csprojcts 2015-11-27 11:35:41 +10:00
amaitland 3f15b53ab7 Resolves #1407
More the DeserializeV8Object call to within the context->Enter so a V8Object can be created
Change callback to use a struct as it's return type to demo the solution to this bug
Add missing list->SetDictionary call in V8Serialization.cpp
2015-11-18 09:17:16 +10:00
illfang 441a2872c5 added multi binding test for testing bindings with multiple contexts and dynamic context creation / destruction
1 browser, multiple changing contexts
also added a link to the popuptest
2015-10-09 15:23:50 +09:00
illfang a9f5ab4c97 merge with master 2015-09-16 18:05:13 +09:00
illfang 94e352908a added test for WebGL content which is loaded in a cefsharp/CefSharp/issues/1226 2015-09-16 17:59:20 +09:00
illfang 81c545cf39 added test html logging exception log messages: ExceptionTest.html
custom://cefsharp/ExceptionTest.html
2015-09-08 11:20:31 +09:00
amaitland 5a09a5ef35 Merge branch 'cefextensions' of https://github.com/arsher/CefSharp 2015-08-03 12:12:51 +10:00
David Serfozo 756bd44bbd added extension example 2015-08-01 20:26:03 +02:00
cefsharp-ms f74b245e9b added examples for async bindings 2015-07-31 17:17:48 +02:00
amaitland 88355c3da9 Update WPF example to use Mvvm Light (replace our basic MVVM implementation)
Makes sense to use an established framework for this sort of thing.
2015-04-30 12:21:38 +10:00
amaitland 5c43063670 Take PR #896 and add code to CefExample project - proxy lookup 2015-04-14 13:29:47 +10:00
amaitland 973da2813a Upgrade CefSharp.Example.csproj to .net 4.5 2015-01-16 17:39:19 +10:00
amaitland fce5f06362 Remove unused resultString param, CefJSDialogCallback->Continue is used for multiple callbacks, in this case only the success param is required.
Change isReload to a normal param (was an out param), so the user can be notified correctly
Add some rough documentation to IJsDialogHandlerAdd some additional comments to JsDialogHandler for demonstrating code to users

Add JsDialogHandler that implements the default behavior
Assign in the WinForms example

Fix typo in IRequestHandler
2015-01-11 14:05:10 +10:00
daveaton 83602ace7d One small issue how to handle
Maybe I am over thinking it ... It probably should be handled like this.

http://www.eatoncode.com/shareit/2014-11-28_2031.png

but I still got an issue.
2014-12-08 20:55:21 +10:00
amaitland 3ce9990807 Merge remote-tracking branch 'remotes/upstream/master' into JsBinding_WIP 2014-10-20 14:16:06 +10:00