Commit Graph

397 Commits

Author SHA1 Message Date
amaitland eaeff85eac WcfEnabledSubProcess - Revert codepage change 2018-06-20 21:01:48 +10:00
João Neves 4f9c95cce3 Close CefSharp.BrowserSubprocess.exe if parent process exits (#2375)
* Close cefsharp subprocess if main process dies

* Code review

* Await before exiting

* Update Program.cs
2018-06-20 21:01:48 +10:00
amaitland a6f0708950 JSB - Manually merge in some changes from https://github.com/cefsharp/CefSharp/commit/8f7692ae6e5c75e26accf49d57f5d8460c81b271
Bound object response was not being sent correctly (format has been updated)
2018-05-22 12:04:10 +10:00
amaitland 8f87f3a77d RegisterBoundObjectHandler - Reduce code duplication slightly
# Conflicts:
#	CefSharp.BrowserSubprocess.Core/RegisterBoundObjectHandler.h
2018-05-16 11:21:19 +10:00
amaitland 4854f4f45c JavascriptRootObjectWrapper - Log error when trying to bind sync object when IBrowserProcess is null 2018-05-16 11:19:56 +10:00
amaitland 930846eb52 JavascriptAsyncMethodHandler - Obtain Promise from context on Execute
Previously the promise reference was passed into the handler, now we obtain the reference on demand
2018-05-15 15:05:29 +10:00
amaitland a8ff890433 Always pass through Process Id to subprocess
Improve command line parsing

Partial import of changes from #2375
2018-04-30 14:21:20 +10:00
amaitland f6e58283a6 LegacyBinding - Remove objects from cache if key already exists
Temp fix for #2301 Will be resolved properly in #2306
2018-04-20 10:45:52 +10:00
amaitland 066f5a92b2 Upgrade to CEF 3.3325.1758.g9aea513 / Chromium 65.0.3325.181 2018-04-17 15:14:42 +10:00
amaitland efff50bf7e Upgrade to CEF 3.3325.1751.ge5b78a5 / Chromium 65.0.3325.181 2018-03-28 13:50:42 +10:00
amaitland c37dbcd06a Remove Geolocation API and Upgrade version numbers to 65 2018-03-17 21:31:25 +10:00
amaitland 8eb9860cac Upgrade to CEF 3.3325.1749.ga42963a / Chromium 65.0.3325.146 2018-03-17 21:29:21 +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 5e6addc0c9 CefTime.GetDoubleT returns invalid .Net date
Issue #2283
2018-03-05 16:55:11 +10:00
amaitland a38df4a268 Default builds to using VS2015
Builds are now done using VS2015 which will require VC++ 2015 (or VC++ 2017 as they are compatible)

Remove VS2013 target from build.ps1
2018-02-05 17:23:34 +10:00
amaitland 9f5a7efe70 Upgrade to CEF 3.3282.1731.gfc9a4fa / Chromium 64.0.3282.119 2018-02-05 17:11:41 +10:00
amaitland 1b00c277b8 JSB Add Caching
Bound object meta data is cached within a render process
CefSharp.IsObjectCached - JS method to test if object cached
CefSharp.RemoveObjectFromCache - JS method to remove object from cache

If a request is made for multiple objects with not all of them being cached then a IPC message is sent.
When all objects already bound return response object for consistency
FindBrowserWrapper signature change - it's really not safe to throw a managed exception in the middle of unmanaged code, changed to logging and null checking
JavascriptObjectRepository - Add All Constant - Used when All objects are requested for binding (objects can also be requested by name)

TODO: Add a JS library to improve user experience when dealing with cached objects
2018-01-30 10:16:28 +10:00
amaitland 934cd70ed6 JSB BindObjectAsync return response object
Can now return additional properties, still need better error handling
2018-01-29 09:45:24 +10:00
amaitland fd64b079a2 IJavascriptObjectRepository.ObjectBoundInJavascript - Fix bug and add example 2018-01-22 12:19:51 +10:00
amaitland 7c699e3ec6 IJavascriptObjectRepositry - Add ObjectBoundInJavascript event
Executed on the thread pool when objects are bound in JS
2018-01-22 12:19:43 +10:00
amaitland 1019ee0a71 WcfEnabledSubProcess - Add better error handling when closing the WCF channel/factory
Resolves #2074
2018-01-22 11:15:44 +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 41b3da004f Cleanup CefTime handling - make consistent across all projects
# Conflicts:
#	CefSharp.Core/ResourceHandlerWrapper.cpp
2018-01-18 10:25:54 +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 6f3016d1a7 Remove additionallibsdirectory references to CefSharp.Core\bin - probably a leftover from years ago before the structure was cleaned up 2017-12-20 10:54:41 +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 93b08f1c12 Upgraded CEF to version 60 (#2159)
* Fixed pointer problem.

* Upgrade to CEF version 60

* Fix for invalid cookie date time

Error and stacktrace:

Year, Month, and Day parameters describe an un-representable DateTime.
   at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)
   at System.DateTime..ctor(Int32 year, Int32 month, Int32 day, Int32 hour, Int32 minute, Int32 second, Int32 millisecond)
   at CefSharp.ResourceHandlerWrapper.GetCookie(ResourceHandlerWrapper* , CefStructBase<CefCookieTraits>* cookie)
   at CefSharp.ResourceHandlerWrapper.CanGetCookie(ResourceHandlerWrapper* , CefStructBase<CefCookieTraits>* cookie)

Fixed by copying the same solution found here:

https://github.com/cefsharp/CefSharp/blob/cd934267c65f494ceb9ee75995cd2a1ca0954543/CefSharp.Core/Internals/CookieVisitor.cpp
2017-11-08 13:08:59 +02:00
GrabzIt 653896a5b3 Merge pull request #2114 from GrabzIt/master
Update to Cef Version 59.0.0
2017-10-07 08:16:54 +01:00
GrabzIt 3d45c10b28 Remove EnsureNuGetPackageBuildImports target 2017-10-06 08:04:25 +01:00
Chris 7e2594d2e3 Added CefCustomScheme.IsCspBypassing
Resolves #2038
2017-08-29 18:00:36 +02: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 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 6d88927be8 Upgrade to CEF 3.2987.1597 2017-03-29 16:12:49 +10:00
amaitland 910df4877a Make callback ids unique within the render process to avoid overlay between different contexts - was possible to dispose of a callback on a different context to which it was created as the Ids were the same
Add IJavascriptCallback.Id - mostly for debugging purposes
2017-03-16 15:32:38 +10:00
João Neves bc83d6c247 Allow calling managed methods from objects bound with RegisterAsyncJsObject that return arrays of structs (#1981)
* Fixed problem when calling CefV8Value::CreateArray. Needs prior call to V8 context enter
* Call callback dispose in case of failure
* Support serialization of struct arrays to JS side
* Fixed formatting
2017-03-13 21:37:55 +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 5d459a5d32 Add IRenderProcessMessageHandler.OnContextReleased - native IPC message sent from render process 2017-03-07 09:23:10 +10:00
Chris cd934267c6 Updated copyright year and made sure it used same format everywhere (#1966) 2017-03-06 08:44:37 +10:00
Chris a89d4070af Updated build script and added assembly details to the C++CLI projects (#1947)
* Made build script update manifest files
* Made build script update AssemblyFileVersion
* Replaced tabs with spaces
* Added resource files to the C++ CLI projects to be able to set the version
* Added the rest of the resource files

* Fix build script error

* Made build script update version in the C++CLI projects

* Fixed WPF browser going blank when connecting over RDP

* Revert "Fixed WPF browser going blank when connecting over RDP"

This reverts commit 3c2997568d.
2017-02-22 10:56:40 +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 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