54 Commits

Author SHA1 Message Date
amaitland 8ff20417e6 Disable CanExecuteJavascriptInMainFrame checks for ExecuteScriptAsync/EvaluateScriptAsync
See #2250 for details (appears to be bug in `CEF`)
2018-01-24 10:17:05 +10:00
amaitland 0acaef4bd0 WebBrowserExtensions.GetHost renamed to GetBrowserHost
Add missing this keyboard to make it an extensions method
2018-01-22 11:32:25 +10:00
amaitland fe026a8f9e Add IWebBrowser.GetHost() extension method - make it easier to directly get the IBrowserHost reference 2017-05-29 13:49:23 +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
amaitland 16dbb10c61 Add ThrowExceptionIfCanExecuteJavascriptInMainFrameFalse method to reduce duplication.
Improve error message, add info about V8Context not being created for pages with no javascript
2017-05-08 13:16:24 +10:00
amaitland a683eade99 Follow up to #2010
ResourceFactoryItem renamed to DefaultResourceHandlerFactory - it's only used in the context of that class
Change persist to OneTimeUse and invert logic (false is the default)
Remove unnecessary RegisterHandler overload - user default value instead
2017-04-10 12:08:05 +10:00
Chris d03e4a44bd Made LoadHtml register a "one-time use" handler 2017-04-07 14:22:47 +02:00
amaitland d60d1b73c8 SetCanExecuteJavascriptOnMainFrame was only being set when there was a RenderProcessMessageHandler assigned, change so it's always set
Improve the formatting of the exception thrown
2017-03-28 10:03:21 +10:00
amaitland eecf3aded9 Add IWebBrowser.CanExecuteJavascriptInMainFrame property, set to true/false when V8Context is created/released
Added checks in the execute/eval javscript methods in WebBrowserExtensions
Made possibly by the addition of OnContextReleased IPC message being added
2017-03-28 09:43:59 +10:00
amaitland b432d5aa38 Change IBrowserHost.SendMouse* to use the MouseEvent struct (added some extension methods to maintain API compatibility)
Review classes and structs
Added constructor to structs where all fields were required
Made some classes sealed, mostly those that are passed into the framework where subclassing and adding methods/properties wouldn't make sense
2017-03-27 15:46:34 +10:00
amaitland 43aa8a35ea Remove IBrowserHost.PrintToPdfAsync - code is now implemented in the PrintToPdfAsync extension method 2017-03-10 14:43:35 +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 55f2c82ac7 Fixed LoadHtml loading the Url even if RegisterHandler returns false (#1943) 2017-02-15 10:01:35 +10:00
amaitland 01e7e6f3d7 Add LoadHtml extensions method - use data uri to load the html 2017-02-02 11:21:14 +10:00
Chris 08bc409047 Added a missing space and made two letters lowercase (#1909) 2017-01-07 07:23:41 +10:00
amaitland 9df1bc132c Add RegisterResourceHandler and UnRegisterResourceHandler to simplify using the DefaultResourceHandlerFactory 2016-12-08 22:14:09 +10:00
amaitland f2050a0861 Add scriptUrl and startLine to EvaluateScriptAsync 2016-12-02 06:10:40 +10:00
PrinceOfEgypt 652a09bf6a Add overloads for EvaluateScriptAsync to support methodName and args (#1738)
* Add overloads for EvaluateScriptAsync to support passing in methodName and args

* Fixing typo (teh => the)
2016-07-13 09:11:32 +10:00
chylex 2532c80971 Fix bool, number culture, and string escaping in ExecuteScriptAsync with parameters (#1731) 2016-07-05 11:23:01 +10:00
amaitland bae3c28e92 Update copyright to 2016 2016-01-11 14:11:30 +10:00
Atvaark b04ccbb269 Add missing comments 2015-11-04 13:10:00 +10:00
amaitland ab894a4ff4 Handle case where args.Length == 0
Previously would have stripped off the last two chars of the script
2015-10-29 11:13:53 +10:00
amaitland e4db664801 Add override to ExecuteScriptAsync extension that takes in a method name and array of params, then generates the relevant script and executes 2015-10-26 12:43:35 +10:00
amaitland 1843486050 Rename CefSharpPdfPrintSettings to PdfPrintSettings (inconsistent naming)
Add xml documentation to PdfPrintSettings
Change return type from Task to Task<bool> (exceptions are expensive and unnecessary)
Fix small bug in assigning HeaderFooterTitle and HeaderFooterUrl (values were switched)
Allow PrintToPdfAsync to accept nullptr for settings (use defaults)
Update xml documentation in various instances for PrintToPdfAsync
2015-09-20 18:43:06 +10:00
David Serfozo 6ecb0fc129 PrintToPdf API changed to use Tasks instead of callbacks 2015-09-19 13:28:52 +02:00
David Serfozo ebd4cb26ab added PrintToPdf extension methods 2015-09-19 12:26:26 +02:00
amaitland 326aaf70f8 Move handlers to their own namespace and create an implementation of LifeSpanHandler to deal with custom popups 2015-08-03 17:57:01 +10:00
amaitland 118182f537 Add modifiers param to SendMouseWheelEvent
Add SendKeyEvent to IBrowserHost including mapping struct classes
2015-07-24 12:23:29 +10:00
amaitland df94d54a61 Remove duplicate GetMainFrame and GetFocusedFrame methods - turned them into extensions 2015-07-01 19:49:27 +10:00
amaitland f239503bb3 Move SendMouseWheelEvent to IBrowserHost 2015-07-01 19:38:14 +10:00
amaitland 091339de25 OffScreen control - update to throw exception if Browser has not been initialized
It's quite common for users to attempt to execute a browser function before it's initialized and for it to silently fail if it's not been initialized
2015-07-01 19:24:49 +10:00
amaitland 2129c1907e Remove IBrowserAdapter from Frame and Browser wrappers - now directly cast CefClient to ClientAdapter so can execute js 2015-06-29 14:03:10 +10:00
amaitland 819dfd54f9 Move WcfEnabled option into CefSharpSettings class
Reduce code duplication - move EvaluateScriptAsync in WebBrowserExtensions
2015-06-29 13:20:47 +10:00
amaitland 124cf84142 Wrap frame calls in using statements (Dispose will be ignored if frame null) 2015-06-15 12:21:22 +10:00
Bill Tutt 3ac316c3c6 Add IBrowser extension methods for IBrowserHost methods, and call from IWebBrowser extensions. 2015-05-28 23:01:30 -04:00
amaitland 16ac917f49 Add some more xml comments to WebBrowserExtensions 2015-05-29 12:08:24 +10:00
amaitland d394124b3a Move public facing CefBrowserHost methods into extension methods that use the IBrowserHost wrapper 2015-05-29 11:23:25 +10:00
amaitland e715c37910 Don't dispose of cefBrowser now that it's a single reference per ChromiumWebBrowser instance - API may still need a few tweaks 2015-05-28 21:00:26 +10:00
amaitland 1163e59aae Dispose of frame when finished (releases the reference to the unmanaged class).
Whilst not strictly required, it's nice to know the frame is explicitly released and for those copying the code, give them a clue that they need to call dispose
2015-05-28 20:28:46 +10:00
amaitland bd3fddddbc Throw exception if null (ThrowExceptionIfBrowserNull)
Dispose of IBrowser once finished (just releases the reference)
2015-05-28 20:26:12 +10:00
amaitland 3038b820ec Slightly better param naming - internalBrowser -> cefBrowser 2015-05-28 20:24:04 +10:00
amaitland 6cd3c67abb Make Reload + ReloadIgnoreCache into one method with a property - makes consistent with the rest of API 2015-05-28 20:23:13 +10:00
amaitland 67d57c96a0 Move Stop/Back/Forward methods into WebBrowserExtensions 2015-05-28 20:20:32 +10:00
amaitland 507fbf0704 Add null check for LoadHtml - add better error message to say that it's only usable with DefaultResourceHandlerFactory 2015-05-28 19:55:45 +10:00
amaitland 3908a6212a Rather than fail silently throw and exception if the frame is null, this is a drastic change in behaviour. Though it provides a much more transparent behaviour though.
Just need to make sure it's easy to check IsBrowserInitialized in all instances to see if it's safe to call methods (should only be called when IsBrowserInitialized is true, only problem with this is in WPF where it's a dependency property)
2015-05-28 19:54:22 +10:00
amaitland d0d409a8fd Rename LoadHtml to LoadStringForUrl (Internal method is LoadString, for some reason that causes the compiler a problem as there is a define already aliasing LoadString).
LoadHtml was a somewhat conflicting name with the LoadHtml extension methods that use a ResourceHandler to load the html
2015-05-27 17:44:03 +10:00
amaitland 8579a6a210 Remove RegisterHandler/UnRegisterHandler methods from the IResourceHandlerFactory interface 2015-05-27 16:21:48 +10:00
amaitland d37dd2d2ef Move LoadHtml into an extension method 2015-05-27 16:18:28 +10:00
amaitland 1ce10ea53f Move LoadHtml (LoadString) to extension 2015-05-21 20:25:02 +10:00
amaitland 1a1fcb9f2e Make the next set of frame related methods into extension methods 2015-05-21 19:12:14 +10:00