1716 Commits

Author SHA1 Message Date
amaitland a688bcbdf8 IFrame.LoadRequest - Update xml doc
LoadRequest can only be called when a render process has already been created, suggest loading a data uri initially

http://magpcss.org/ceforum/viewtopic.php?f=6&t=16058&p=38563&hilit=LoadRequest#p38559

Resolves #2451
2018-07-13 10:29:41 +10:00
amaitland a338369eea Add IJavascriptObjectRepository.UnRegisterAll
UnRegisterAll all bound objects - does not unbind them from the JS context
2018-07-13 10:29:40 +10:00
amaitland 454fdb8f2d Add IJavascriptObjectRepository.UnRegister
Allows for an object to be removed from the repository, doesn't unbind the object from javascript though
2018-07-13 10:29:39 +10:00
amaitland 7ab90eeaaa CefSharpArguments.ExitIfParentProcessClosed - Change to lowercase
Chromium changes the args to lowercase, so we switch to lowercase for compare.
2018-06-25 21:29:52 +10:00
amaitland 130c3789f5 CefSharpSettings.SubprocessExitIfParentProcessClosed - only spawn task to monitor parent if command line arg present
Follow up to #2375
2018-06-20 21:01:49 +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
Philipp Feigl a9a8cb83da Update DependencyChecker with now required "v8_context_snapshot.bin" file (#2399) (#2400) 2018-06-20 21:01:47 +10:00
amaitland 8716c56e22 JSB - Manually include the additional changes from https://github.com/cefsharp/CefSharp/commit/8f7692ae6e5c75e26accf49d57f5d8460c81b271 2018-05-16 12:41:56 +10:00
amaitland 2220ee49ba JavascriptBindingExtensions - Remove unnecessary async keyword from script 2018-05-16 11:19:55 +10:00
amaitland 7440a91d46 Untabify JavascriptBindingExtensions 2018-05-16 11:19:55 +10:00
amaitland 2e01de8250 JSB - Add EnsureObjectBoundAsync method
To support this use case added IJavascriptObjectRepository.ObjectsBoundInJavascript (called a single time with names of all objects bound)

Implements the idea put forward in #2362

# Conflicts:
#	CefSharp/Internals/JavascriptObjectRepository.cs
2018-05-16 11:19:54 +10:00
amaitland 6e21e04d85 ResourceHandler - Add argument null/empty checks 2018-05-03 11:29:14 +10:00
amaitland b034d1c552 Task Callbacks - only call TrySetResultAsync if the callback was never called
Add IsDisposed property to ICompletionCallback, IPrintToPdfCallback, IRegisterCdmCallback, IResolveCallback
Should resolve #2349 until the code review can be finished
2018-04-30 14:21:21 +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 801d53b3cf Add JavascriptBindingCompleteEventArgs - Use for IJavascriptObjectRepository.ObjectsBound event
This contains the breaking changes required for #2362
2018-04-27 16:33:42 +10:00
amaitland c1b89c62e9 WPF/OffScreen - Code cleanup and minor refactor
IRenderWebBrowser - Method naming now matches CEF, xmldoc updated to be more accurate

CefSharp.Wpf.ChromiumWebBrowser and CefSharp.OffScreen.ChromiumWebBrowser both updated as a result of IRenderWebBrowser changes
Should be minimal public API changes, should only require changes for those that are implementing their own rendering, who will have a major rewrite on their hands regardless of this.
2018-04-20 14:49:25 +10:00
amaitland b492905cea Code cleanup - Move some structs and enums into separate namespace
- Move the less likely to be used structs/enums into the relevant namespaces, would ideally like to move them all, would likely cause a few issues
for some when upgrading though, so deferring for now.
- Remove Geoposition as it's no longer used (Geolocation API was removed in CEF)
2018-04-20 12:56:32 +10:00
amaitland 7490b53490 IDragData.GetFileContents - update to properly closer represent the CEF API
Pass in null to get the stream size, pass in a valid stream (typically MemoryStream) to get the actual contents
2018-04-19 17:39:21 +10:00
James Coyle 4c555d7223 Handle URL escaped paths correctly (#2364)
Allows for the FolderSchemeHandler to correctly parse encoded URLs such as URLs containing spaces in requests from the currently loaded page.
2018-04-19 14:20:54 +10:00
amaitland ccc549ba1f IRenderWebBrowser - Add StartDragging xml doc 2018-04-16 17:26:23 +10:00
amaitland a17150c40d IDragData - Add Clone method 2018-04-16 17:26:22 +10:00
amaitland 82630ec396 CefDrawData - Add Image
Add IImage interface and supporting structs/enums
2018-04-16 17:26:21 +10:00
amaitland d99d6d87fe Set event handlers to null in Dispose
Not all event handlers were set to null on Dispose in ChromiumWebBrowser instances and JavascriptObjectRepository

Resolves #2307
2018-04-13 16:18:57 +10:00
amaitland 2fbc0bb5a1 WebBrowserExtensions - Rename ExecuteScriptAsyncEncodeString to EncodeScriptParam
Method is used by both eval and execute so make name more generic. Improve xmldoc slightly
2018-04-03 14:22:32 +10:00
amaitland 431fe76a39 WebBrowserExtensions - Add ExecuteScriptAsyncEncodeString to allow for custom encoding of string params used with ExecuteScriptAsync overload
Also rename test case and add comment

Follow up to #2340
2018-04-03 14:12:10 +10:00
Garr Godfrey 7e30861bc2 Encode string parameters to pass unchanged.
enter the commit message for your changes. Lines starting
2018-03-28 22:28:01 -07:00
amaitland a87d834409 Add Cef.GetBlockingCookieManager, IRequestHandler.CanGetCookies and IRequestHandler.CanSetCookie
RequestEventHandler example implementation is incomplete
2018-03-28 14:28:38 +10:00
amaitland c37dbcd06a Remove Geolocation API and Upgrade version numbers to 65 2018-03-17 21:31:25 +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 7d720c6f80 ResourceHandler.FromFilePath - Remove Obsolete attribute
Update to use File.OpenRead and FromStream method instead
2018-03-05 16:36:22 +10:00
amaitland f67ff89e44 Geolocation - Mark as obsolete/deprecated
See #2293 for details
2018-03-05 16:34:35 +10:00
amaitland 5a5ba89ebf ResourceHandler.FromFilePath - Mark as Obsolete
There are problems with multiple concurrent calls to the underlying CefResourceHandler

See #2041 for background
2018-03-05 16:14:19 +10:00
amaitland 3175968339 Fix Async JSB unable to return class
Added note about memory leak
Added Test case to validate fix
2018-03-05 14:02:59 +10:00
amaitland 9fc2f33ea8 Xml Doc improvements
Fix some invalid markup
Move some unmanaged constructors and implicit conversion to internal
2018-02-09 13:41:55 +10:00
amaitland 4d4607f24a ICookieManager - Improve xmldoc wording around how methods are executed.
Most methods are executed in an async fashion with a callback that notifies of completion.
Set ICookieManager.DeleteCookies params to null by default (they're optional)
2018-02-08 10:46:52 +10:00
amaitland 91da9ea8a4 JSB - Improve xmldoc for IJavascriptObjectRepository 2018-02-07 12:55:40 +10:00
amaitland 38be769f96 OnConsoleMessage - Add LogSeverity 2018-02-05 17:30:44 +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 e88baebc17 Minor API Cleanup
- Move ITaskScheduler and InternalWebBrowserExtensions into Internals folder (not for public use)
- Improve some of the API xml doc
2018-02-05 14:28:17 +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 2b49105b6f JSB - Fix bug where properties weren't being analysed for sync bound objects
Added test case
Reordered method to make it more logical, used named properties so it's clear what's being set.
Add TODO for unresolved object event
2018-01-29 10:15:01 +10:00
amaitland 68c9a6418c Disable CanExecuteJavascriptInMainFrame checks for ExecuteScriptAsync/EvaluateScriptAsync
See #2250 for details (appears to be bug in `CEF`)
2018-01-24 10:16:01 +10:00
amaitland 4b3c04a615 IJavascriptObjectRepository.Register - Improve isAsync xml doco comment 2018-01-23 18:41:13 +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 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 67b8b038af Untabify
Follow up to #2218
2018-01-18 11:51:09 +10:00
João Neves b1b8f43859 Dont discard null Values from arrays (#2218)
* Don't discard arrays that contain null values
* Revert unintended change in this branch
* Added qunit test
* Code review and added new tests
2018-01-18 11:46:58 +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