150 Commits

Author SHA1 Message Date
Alex Maitland c630d77ef3 Test - Add Test to verify workaround for issue #3470 2021-04-28 13:36:50 +10:00
Alex Maitland 38215a3230 Core - Remove ICookieManager.SetSupportedSchemes
- The method was removed upstream.
- New properties have been added to CefSettings and RequestContextSettings

**Breaking Change**

Resolves https://github.com/cefsharp/CefSharp/issues/3497
2021-04-23 17:00:21 +10:00
Alex Maitland 5def74a1f0 Example - Add CefSettings.ChromeRuntime (commented out) 2021-04-23 16:36:09 +10:00
Alex Maitland 268e3024ae Example - Remove renderer-process-limit and add disclaimer
Related #3447
2021-03-22 14:25:19 +10:00
Alex Maitland bc9b3d1a16 Test - Update remaining QUnit tests to async
Follow up to #3298
2020-12-16 11:26:29 +10:00
Alex Maitland 833ebe49a6 Net Core - BrowserSubprocess compile as x86/x64 variants
Using an AnyCPU process wouldn't load when the browser process was x86
Basically x86 browser process couldn't use an x64 subprocess

Issue #3197
2020-11-06 17:41:45 +10:00
amaitland 3230444045 WPF Example - Add Chrome internal Urls menu
- Add new menu for testing/debugging purposes
2020-09-16 14:32:30 +10:00
amaitland 53f15f22eb Upgrade to CEF 85.3.6+gacfac2f+chromium-85.0.4183.102 / Chromium 85.0.4183.102
- Remove CefSettings.RegisterExtension (#3184)
- Add IRenderProcessHandler.OnWebKitInitialized
- Add Cef.RegisterExtension (Browser SubProcess specific implementation)

Resolves #3184
2020-09-16 13:49:37 +10:00
amaitland 1af1065f03 Net Core - Add XUnit Test Project
Issue #3197
2020-07-24 21:07:29 +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
Konstantin Preißer 5e89f71a44 Add new projects targeting .NET Core 3.1 (#3181)
* Add .NET Core 3.1 projects for CefSharp, CefSharp.Core, CefSharp.BrowserSubprocess.Core, CefSharp.WinForms, CefSharp.Wpf, CefSharp.OffScreen.

Contributes to CefSharp#2796

* - Remove dependencies to "opengl32.lib" and "glu32.lib" which aren't available for ARM64 and don't seem to be needed.
- Clean up project files.

* Switch project CefSharp.netcore.csproj to AnyCPU as it doesn't require different builds for each platform.

* Remove WindowsTargetPlatformVersion property as that is declared in CefSharp.props.

* Use "bin.netcore" and "obj.netcore" as [intermediate] output path for the .NET Core projects, to allow side-by-side builds with the .NET Framework projects.

* Output documentation files.

* Add CefSharp.Example.netcore and CefSharp.WinForms.Example.netcore.

* Follow-up: Remove properties from the example projects that are also not used in the corresponding .NET Framework projects.
2020-07-23 15:21:14 +10:00
amaitland 971b7671a6 Core - Allow overriding of enable-features command line arg
Added example of NetworkServiceInProcess

NOTE: Running the Network Service in Process is not something CEF officially supports
It may or may not work for newer versions.
2020-06-19 20:48:25 +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 e1401e7092 Core - Ensure CachePath/RootCachePath/LocalesDirPath/BrowserSubprocessPath are absolute
CEF now requires this to be absolute, we enforce this by throwing exception if non-absolute

Resolves  #3102
2020-05-03 16:59:57 +10:00
amaitland 4d7fa50c16 Example - Make BrowserSubProcess paths absolute
Issue #3102
2020-04-29 08:13:08 +10:00
amaitland ea3b1398d0 Example - RegisterTestResources now registers resource if no factory found 2020-04-08 18:07:01 +10:00
amaitland 73e7c5de13 Core - Rename AbstractCefSettings to CefSettingsBase
This is a somewhat cosmetic change so the API Doc looks better, the
classes appear next to each other (CefSettings, CefSettingsBase)
when sorted alphabetically.

Resolves #3093
2020-04-06 14:59:33 +10:00
amaitland 1b5795cff7 CefSharp.Example - Add Disable WebAssembly example 2019-11-23 13:55:13 +10:00
amaitland ac07860cba CefExample - Add example of disable-site-isolation-trials command line arg 2019-11-23 06:47:29 +10:00
amaitland 446093b6c3 CefExample - Remove disable network service example
No longer possible to disable network service
2019-10-02 12:30:30 +10:00
amaitland f088a7c169 CefSettings - Add custom dictionary to allow setting of command line args with no value
- Updated CefExample to remove "1" values from the command line arg examples

Issue #2858
2019-09-06 13:05:50 +10:00
amaitland cdca99c548 CefExample - Remove disable-direct-write
No longer supported by Chromium.
2019-07-18 19:59:47 +10:00
amaitland 3bb2175919 CefExample - Disable LegacyBindingEnabled
Accidentally enabled it previously
2019-07-08 08:33:39 +10:00
amaitland cabf363061 CefSharpSettings.LegacyJavascriptBindingEnabled - Change xml doc
Also change comment in CefExample
2019-07-03 20:31:21 +10:00
amaitland b68d8d7a8f RequestHandler - Change interface implementation to be explicit
- Make members protected virtual (BREAKING CHANGE)
- Remove Default from name of DefaultResourceRequestHandlerFactory/DefaultResourceRequestHandlerFactoryItem
2019-06-25 19:24:57 +10:00
amaitland 5459cc5709 CefExample - Switch to using https://cefsharp.example url instead as custom scheme is broken currently.
Reported upstream at https://bitbucket.org/chromiumembedded/cef/issues/2685/networkservice-custom-scheme-unable-to
2019-06-25 19:24:57 +10:00
amaitland 105cf8f3af CefExample - Register https://cefsharp.example scheme handler factory for testing 2019-06-25 19:24:57 +10:00
amaitland 73a156fdc5 Initial version 75 upgrade and NetworkService changes
Compiles, that's about it at this point, there are major CEF breaking changes, and lots to be addressed.

Browser Process (main process)
- Removed IResourceHandlerFactory as it no longer fits with the structure that CEF provides
- New IResourceRequestHandler interface added, not plumbed in yet
- CefSettings - Add RootCachePath and ApplicationClientIdForFileScanning

BrowserSubprocess (render process)
- SendProcessMessage was moved from CefBrowser to CefFrame
- OnBrowserCreated added extraInfo param

The BrowserSubprocess changes for this upgrade should be complete
2019-06-25 19:24:57 +10:00
Alex Maitland fe98124c9b Async JavascriptBinding - Add support for returning Task (#2771)
* Async JavascriptBinding - Add support for returning Task

Remove Parallel Task execution code from MethodRunnerQueue
Add ParallelMethodRunnerQueue
  - For the new code path the Func is executed, if the Result is a generic Task we wait for it's completion
  - If the task is not generic then we return immediately

This is only enabled when CefSharpSettings.ConcurrentTaskExecution = true;
* MethodRunnerQueue - Display error message when method returns Task
* ParallelMethodRunnerQueue - Rename to ConcurrentMethodRunnerQueue
* MethodRunnerQueue - Improve formatting of error message when method returns Task
* Async JavascriptBinding Return Task - Add Basic xUnit Test

Very quick test, needs to be refined a little. The basics are working as expected.

* Add Binding Test Async Task Example to the WPF Example menu

* Async JSB Task - Add additional tests and improve error messaging
2019-06-08 17:21:49 +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
João Neves 6692749728 WPF - Implement UpdateDragCursor (#2691)
* Close cefsharp subprocess if main process dies

* Implemented UpdateDragCursor

* Fixed braces position

* Added license header

* Fixed cursor flickering

* Added test

* Fixed build

* Fixed move cursor

* Fixed braces

* Simplified solution

* Fixed dropping Link effect

* Fixed encoding + Removed leftovers
2019-04-05 11:58:27 +10:00
amaitland db306a64c9 CefExample - Add autoplay-policy example 2019-03-20 21:51:18 +10:00
Alex Maitland 9d2c66f584 Cefexample Add link to cef specific command line args 2019-02-19 10:07:11 +10:00
amaitland 11a8371e19 Rename CefExtension to V8Extension
Resolves #2612
2018-12-27 15:47:29 +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
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 f6088f33d2 DefaultResourceHandlerFactory - Rewrite so it stores byte[] instead of storing IResourceHandler
It's not actually a factory and will handle multiple requests to the same url

Only API change is for DefaultResourceHandlerFactory directly, the LoadHtml and RegisterResourceHandler extension methods
stay unchanged
2018-08-13 12:39:04 +10:00
amaitland d87e795000 WinForms/Wpf/OffScreen - Create specific CefSettings class for each version
- This is a breaking change as there is no common `CefSharp.CefSettings`, there is no `CefSharp.Wpf.CefSettings`, `CefSharp.WinForms.CefSettings` and `CefSharp.OffScreen.CefSettings`
 - Cef.Initialize has been removed, the `ChromiumWebBrowser` constructor will call the `Cef.Initialize` with the defaults for your flavour
 - CefSettings.FocusedNodeChangedEnabled has been moved to CefSharpSettings.FocusedNodeChangedEnabled

Resolves #2477
2018-08-02 10:47:12 +10:00
amaitland 10a891548b WPF/OffScreen Example - Disable SurfaceSynchronization
https://bitbucket.org/chromiumembedded/cef/src/514ced40ceffa16966d9dee23a253014faf74d72/libcef/browser/osr/render_widget_host_view_osr.cc?at=3396&fileviewer=file-view-default#render_widget_host_view_osr.cc-243 (Apparently only relevant for 3396 branch)

See https://github.com/cefsharp/CefSharp/issues/2431
2018-06-27 20:42:53 +10:00
amaitland 3b6ff2fdbd WPF - Mouse Scroll becomes unresponsive
Add Hack to CefSharpApp to allow for setting of disable-features command line arg
Add the example command line args
https://github.com/cefsharp/CefSharp/issues/2408
2018-06-14 22:33:47 +10:00
amaitland e4535ab9df CefSharpSettings.SubprocessExitIfParentProcessClosed - only spawn task to monitor parent if command line arg present
Follow up to #2375
2018-06-11 22:18:51 +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 fb374c0f94 CefExample - Add CefSharpSettings.Proxy example 2018-03-05 16:18:25 +10:00
amaitland 4b4e568f7d Add BindingTestSingle.html
Simple test page that can be used to test cases in isolation (useful for debugging purposes)
2018-03-05 14:02:59 +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 6691d0080a Refactor ResourceHandler, split FileResourceHandler out into it's own class, rather than relaying on ResourceHandlerType - this allows us to add more underlying CEF type wrappers without a huge amount of effort now.
Add new ByteArrayResourceHandler - uses CefStreamReader::CreateForData to load the byte array, for use with CefStreamResourceHandler
Add ResourceHandler.FromByteArray method for ease of use
Change ResourceHandler.FromString to use the new ByteArrayResourceHandler class
2017-05-05 12:55:44 +10:00
amaitland 767b478dc6 Add Experimental option where bound async methods are queued on TaskScheduler.Default.
Set `CefSharpSettings.ConcurrentTaskExecution = true;` to enable this feature, should be set before the first ChromiumWebBrowser instance is created.
2017-05-04 12:53:48 +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