Commit Graph

147 Commits

Author SHA1 Message Date
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 37231bcd9b WPF Example - Add namespace qualifier to WpfImeKeyboardHandler
Use the full namespace instead to make it clearer (technically the partial namespace prefix will work).

Replaces #3607
2021-07-22 10:40:43 +10:00
Alex Maitland 842429a76e WPF Example - Implement DisplayHandler.OnFullscreenModeChange
- Use the new CefSharp.Handler.DisplayHandler base class
- Update xaml so ChromiumWebBrowser has direct reference to DataContext
- When fullscreen create new window and move the browser, move back when exit fullscreen
2021-05-16 16:28:29 +10:00
Alex Maitland a48cf807e6 WPF - Allow setting Focus before the underlying browser has been initialized.
- Remove hacks from the ViewModel as Focus can now be set on Go().
- Creating a new viewmodel also sets focus

Changing tabs doesn't set focus currently.
2021-05-10 15:39:32 +10:00
amaitland da8ad192a4 WPF - Add Experimental Accessibility Handler 2020-07-27 20:32:24 +10:00
Justin D'Arcangelo e834d89518 Fix Issue #2053 - Add accessibility support for WPF 2020-07-27 20:32:24 +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
Roh yeon jin f9acbdfde5 WPF - IME Transparent Text Background (#3143)
* The background color of ime text has been changed to transparent.

* added static methods on imehandler for set background color or underline color through wpfimekeyboardhandler constructor.

* changed codes for a pull request

* removed unused a method

* clean up codes

Co-authored-by: 노연진(Roh Yeonjin)(nyjin) <nyjin@ncsoft.com>
2020-07-23 15:01:25 +10:00
Alex Maitland 8d25b71490 Core - Re-Add IAudioHandler (#3153)
Resolves #3152
2020-07-08 08:06:16 +10:00
amaitland ae41e10d71 Core - Javascript Binding Configure Property Name
- Rename settings object to JavascriptBindingSettings
- Validate JavascriptBindingSettings.JsBindingGlobalObjectName in setter to provide immediate
  feedback
- Add FreezableBase which throws exception when frozen (we can reuse this for some other settings classes)
- Add some basic Unit Tests (More would be better)

Follow on from #3126
2020-05-30 19:28:50 +10:00
amaitland ae17525092 WPF Example - Can now run LegacyBindingTest from menu without code change
It's a bit of a hack at this point, have to read the property from the DataContext.
Need to work on a clean binding solution

Issue #2977
2020-05-23 20:08:51 +10:00
amaitland 0d399e6fd4 WPF Example - Update EvaluateJavascriptTextBox to simple js example
Use 1 + 1 as a simple example

Objects aren't bound on the home page so the old script would fail to execute.
2020-04-29 08:07:33 +10:00
amaitland 0f22224c37 WPF Example - Readd Legacy Binding
if CefSharpSettings.LegacyJavascriptBindingEnabled then register bound and boundAsync objects
2020-04-28 20:54:22 +10:00
amaitland cb429ce9bf WPF - Improve ToolTip Text Wrapping
When no ToolTip style is defined we'll use a TextBlock to wrap the text so it's
usable by default. If a style is applied then we leave it up to user.

Resolves #2488
2020-04-08 16:43:47 +10:00
amaitland 344a9297dd Examples - Update ResourceHandler.GetMimeType to Cef.GetMimeType
Transition away from our incomplete implementation to using the Chromium mapping

Issue #3041
2020-03-26 08:50:07 +10:00
amaitland ffaff5d151 Core - Remove WebBrowserExtensions.RegisterJsObject and WebBrowserExtensions.RegisterAsyncJsObject
This is a breaking change, these methods are being removed as they are used for LegacyBinding which is being drastically changed in #2977

Resolves #2990
2019-12-11 10:08:08 +10:00
amaitland 802bb7f43c Remove IAudioHandler
The Chromium implementation has changed so dramatically that CEF has removed support see https://bitbucket.org/chromiumembedded/cef/commits/1f893c76a97eaa88e3ff782b8e2e47dd0f5d27b2

Track https://bitbucket.org/chromiumembedded/cef/issues/2755/reimplement-audio-mirroring-for for details on when it will be reimplemented

Original Issue #2727
2019-10-01 20:06:37 +10:00
amaitland 07880f0074 WPF Example - Improve demo of hosting popup in ChromiumWebBrowser instance
- LifespanHandler renamed to ExperimentalLifespanHandler to make it clear the feature is experimental
- Add additional check for devtools popup
2019-08-12 12:03:52 +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 7e084f7439 WPF Example - Register cefsharp.example scheme handler factory
Example is commented out
2019-07-04 10:43:38 +10:00
amaitland 7e731b0fa9 Code Cleanup - Rename DefaultRequestHandler to RequestHandler
Also renamed CefSharp.Example.Handlers.RequestHandler to CefSharp.Example.Handlers.ExampleRequestHandler

Will Add in Obsolete DefaultRequestHandler
2019-06-25 19:24:57 +10:00
Alex Maitland 1a2c8ffcb6 Add CefSharp.PostMessage (#2799)
- JavascriptMessageReceived event added to ChromiumWebBrowser/IWebBrowser
- CefSharp.PostMessage and cefSharp.postMessage added to V8Context on creation for use in Javascript
- Add PostMessageTest.html
2019-06-03 21:08:03 +10:00
Alex Maitland 76e5a8d5c0 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 12:54:40 +10: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 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 c7c98a4551 WPF Example - Readd EvaluateJavaScriptResult which was accidentally removed 2018-08-23 13:56:25 +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 1502a06eb6 BrowserSettings/CefSettings BackgroundColor xml doc updated
Also added Cef.ColorSetARGB helper function
2018-07-16 20:20:13 +10:00
amaitland 709645a195 WPF Example - Remove commented out context menu code
Left over from when the built in wasn't working (it still only works partially) due to https://github.com/cefsharp/CefSharp/issues/1767
Improve comments and add links to make clearer
2018-07-09 20:04:41 +10:00
amaitland cf04ab4b2e WPF - Add basic JavascriptBindingStressTest command
Loads JSB test page and then reloads every 10 seconds
2018-06-30 15:40:57 +10:00
amaitland c37dbcd06a Remove Geolocation API and Upgrade version numbers to 65 2018-03-17 21:31:25 +10:00
amaitland be50b75648 JSB - Wpf.Example update to use ResolveObject method for testing fix for #2273 2018-02-13 12:55:01 +10:00
amaitland e47157f195 WPF Example - Add LegacyBinding options and some better comments 2018-01-22 12:33:48 +10:00
amaitland fd64b079a2 IJavascriptObjectRepository.ObjectBoundInJavascript - Fix bug and add example 2018-01-22 12:19:51 +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
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 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
João Neves 402b2b9980 Add BindingOptions.MethodInterceptor (#2015)
* Added managed methods interception mechanism
* Introduced requested changes (improved comments and namming)
2017-06-01 10:58:43 +10:00
Chris 2b7bdf863f Updated OnTooltipChanged to allow for modifying text (#1953)
* Updated OnTooltipChanged to allow for modifying text

* Updated examples
2017-05-15 02:52:02 +02: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
Chris cd934267c6 Updated copyright year and made sure it used same format everywhere (#1966) 2017-03-06 08:44:37 +10:00
Philip Beber b47731de5e Added DownloadItem .OriginalUrl (#1877)
* Added "OriginalUrl" property to DownloadItem which wraps "GetOriginalUrl" in CEF.

Added a sidebar to the example app which shows the DownloadItems as received by CefSharp.Core/Internals/TypeConversion.h

Added a View menu for hiding/showing the regular sidebar and the new download info sidebar.

* Pull request feedback
2016-12-04 22:26:49 +10:00
amaitland 6ed54d3ad5 Update cherry picked commits to reflect IRequestContextHandler (replaced IPluginHandler) 2016-09-26 09:08:42 +10:00
amaitland 2b419cd29f Add example of setting preference on RequestContext you just created 2016-09-26 09:06:29 +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 4a8b7c559a Re-enable the WPF LifespanHandler just comment the code out - add experimental note 2016-05-27 12:04:06 +10:00
amaitland 165cc1f88a Add a more complex example of using a non draggable region within a draggable one
Switched to using System.Drawing.Region for proper region handle
2016-04-13 11:35:40 +10:00