Commit Graph

708 Commits

Author SHA1 Message Date
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 7128ef11aa WPF Example - windowInfo.SetAsWindowless no only takes a single param (remove transparency param as that's now set via backgroundcolor) 2018-01-18 15:06:01 +10:00
amaitland 127c00554f Rewrite WPF/OffScreen OnPaint
OffScreen
  - Now maintains a raw Byte[] buffer that is used to create the GDI bitmaps
can be overridden and raw buffer access granted (eliminates the forced memory copy to the memory mapped view)

WPF
  - MemoryMappedFile.CreateNew is now used to create the in memory view and copy the buffer
  - InteropBitmapFactory only create new MemoryMappedFile selectively. If the MemoryMappedFile is larger than we require then just reuse it rather than
    releasing then allocating a smaller section of memory that's used for double buffering with InteropBitmap and WritableBitmap
  - Removed CefDirtyRect and used existing Rect class
  - Rename rendering event to Paint, still preferable to implement IBitmapFactory or subclass ChromiumWebBrowser
  - Update ChromiumWebBrowserWithScreenshotSupport to support new rendering method - not very well tested.

Resolves #2237
2018-01-18 11:29:12 +10:00
amaitland 0032ae463f WPF Example - update MenuHandler to implement custom menu, execute command based on CefMenuCommand enum rather than trying to use IRunContextMenuCallback which isn't working (upstream issue)
This is a workaround for #1767
You can use the default CEF menu it does however require you to integrate CEF into your main message loop see #1795
2018-01-18 10:25:50 +10:00
amaitland 55fb0350a6 WPF Example - Add ChromiumWebBrowserWithScreenshotSupport example - adapted from https://github.com/cefsharp/CefSharp/pull/462/
When screenshot is requested then rendering to the screen is temp disabled, browser is resized and frames are used to take the screenshot
2018-01-18 10:25:49 +10:00
amaitland 5dfd24bddb Upgrade to CEF 3.3239.1723.g071d1c1 / Chromium 63.0.3239.132 2018-01-12 15:45:50 +10:00
amaitland ea4cafed18 Upgrade to CEF 3.3239.1716.g735b746 / Chromium 63.0.3239.109 2017-12-29 22:10:13 +10:00
amaitland 1ae29bdb78 Upgrade to CEF 3.3239.1709.g093cae4 / Chromium 63.0.3239.109 2017-12-26 09:17:52 +10:00
amaitland a6f20e82bc Upgrade to CEF 3.3239.1705.gf6d6dfc / Chromium 63.0.3239.109 2017-12-21 11:13:02 +10:00
amaitland 921ea55fff Add IDisplayHandler.OnAutoResize, IBrowserHost.SetAccessibilityState, IBrowserHost.SetAutoResizeEnabled
Wrappers for new methods/callback added
2017-12-21 08:53:56 +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 da898cc93b RequestContextHandler - Add CookieManager type checking
Type check that ICookieManager is of type CookieManager, not currently possible to provide a custom implementation.
Changes in response to #2189
2017-12-20 09:52:01 +10:00
amaitland 2c935268e6 Upgrade to CEF 3.3239.1700
Update version numbers to 63.x
Remove EnsureNuGetPackageBuildImports targets (newer nuget restore method should always be used)
cef.redist targets updated as package structure changed with commit https://github.com/cefsharp/cef-binary/commit/982a6330e70a75860bc6ecb6f84d55456b847d68
(Swiftshader should now be supported)
2017-12-19 11:44:34 +10:00
Per Lundberg a15986979e Upgraded to CEF 62 (#2203)
* Upgraded to CEF 62.
* Upgraded CEF version in README.md
* Bumped appveyor etc versions to 62.0.0.
2017-11-30 21:43:11 +02:00
GrabzIt fb5a0bb9ac Removed EnsureNuGetPackageBuildImports 2017-10-06 08:08:31 +01:00
GrabzIt 2f680f01b7 Updated version 59.0.0 to latest build 3.3071.1649 2017-08-18 20:37:41 +01:00
GrabzIt 08444fe035 Updated to version 59.0.0 2017-08-18 16:07:03 +01:00
GrabzIt 35f9cc3377 Update to Cef Version 59.0.0
Note that there is one breaking change as offscreen windows are now automatically transparent due to this cef change: https://bitbucket.org/chromiumembedded/cef/commits/3f71138d64586d774f645a6db5283b5205ea9df4

To make a offscreen window non-transparent you need to set the background colour as shown below were it is set to white:

browserSettings.BackgroundColor = 0255255255;
2017-08-18 15:45:52 +01: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
amaitland b2143f60d1 Add IWebBrowser.LoadUrlWithPostData extension method (in WebBrowserExtensions) - simplifies calling LoadRequest
Add IPostData.AddData extension method (in PostDataExtensions)
WPF Example change from calling LoadRequest to using new LoadUrlWithPostData extension method
2017-05-26 11:24:45 +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 5b472f7258 Upgrade version numbers to 58 - this is for development purposes only, there is no planned 58 version, next version is 59
Upgrade to CEF 3.3029.1611.g44e39a8 / Chromium 58.0.3029.81
2017-05-05 10:46:54 +10:00
amaitland 858bfd3cf6 Upgrade to CEF 3.2987.1601 2017-04-10 11:11:41 +10:00
amaitland 9bbe75f287 Upgrade to CEF 3.2987.1599 2017-04-06 12:20:59 +10:00
amaitland 6d7e21bb62 Revert "Disable VS hosting process for x64"
This reverts commit 26574eb2f6.
2017-03-29 16:15:04 +10:00
amaitland 6d88927be8 Upgrade to CEF 3.2987.1597 2017-03-29 16:12:49 +10:00
amaitland 26574eb2f6 Disable VS hosting process for x64 2017-03-13 11:08:40 +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
Chris cd934267c6 Updated copyright year and made sure it used same format everywhere (#1966) 2017-03-06 08:44:37 +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 8a9b0deb60 Upgrade to 3.2883.1552
Add isMainFrame to IRequestContextHandler.OnBeforePluginLoad (CEF API changed)
2017-02-01 13:58:51 +10:00
amaitland 03560374cc Crash Reporting - getting errors in logs when attempting to enable crash reporting so leave disabled for now 2017-01-16 11:57:17 +10:00
amaitland b72b6f7310 Example projects - Remove workaround for crash reporting spawning man app exe and switch to using crash_reporter.cfg 2017-01-16 11:38:38 +10:00
amaitland 8166a34c88 Upgrade to 3.2883.1545 2017-01-16 11:19:27 +10:00
amaitland db238f0838 Upgrade to 3.2883.1542 2017-01-12 13:09:35 +10:00
amaitland 4c4f2e7da7 WPF - Add Program.cs to deal with Crashpad process 2017-01-06 13:56:25 +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 80d6a023df Upgrade to 3.2883.1539 2016-12-01 22:56:06 +10:00
amaitland 7b491fbd3d WPF - Add browser.IsPopup checks to the example LifespanHandler when using EXPERIMENTAL newBrowser method
Was hanging on exit before
2016-10-24 12:14:07 +10:00
amaitland 23b8e1c14a WPF Example - Add Zoom out to menu 2016-10-24 09:36:02 +10:00
amaitland c81f57c4ce Wpf Example - improve focus handling and null checking 2016-10-19 16:33:35 +10:00
amaitland cce8cd825d Upgrade to 3.2840.1493 (Chromium 54.0.2840.59)
Add IResponse to IRequestHandler::OnResourceRedirect
2016-10-19 08:17:50 +10:00
amaitland 662ef561b5 ILifeSpanHandler.OnBeforePopup - Add comment about setting newBrowser to null 2016-10-12 12:43:11 +10:00
amaitland e59026dba2 Upgrade to 3.2785.1482 2016-10-04 13:55:05 +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