Commit Graph

1616 Commits

Author SHA1 Message Date
Alex Maitland 009687f7dd Core - SetCrashKeyValue fix key not being passed to CEF 2022-02-22 11:33:47 +10:00
Alex Maitland 54bd29a551 Core - Fix typo 2022-02-22 11:17:40 +10:00
Alex Maitland 571a1db548 Core - Further migration of extensions methods from IWebBrowser to IChromiumWebBrowserBase
- EvaluateScriptAsync can now be used from IChromiumWebBrowserBase, if also IWebBrowser then
main frame check will occur as previous.

Related to #3944
2022-01-10 13:44:29 +10:00
Alex Maitland 8160ec1ce4 Remove IRequestContextHandler.OnBeforePluginLoad and IRequestContext.PurgePluginListCache
Resolves #3924
2021-12-07 14:54:11 +10:00
Alex Maitland 0fc3ae2323 Core - Add CefSettingsBase.IsDisposed
- Dispose CefSettingsBase
- Take a copy of the CefSettings struct and free our pointer
2021-11-25 09:45:29 +10:00
Alex Maitland d46f6380ad Core - Cef.InitializeAsync add optional IBrowserProcessHandler param
Issue #3634
2021-10-28 11:10:08 +10:00
Alex Maitland 4a07af26e9 Core - Rename WaitForBrowserInitialLoadAsync to WaitForInitialLoadAsync and simplify
- Initial intention was to have a reusable method that could be used CefSharp.Wpf.HwndHost,
  upon further deliberation I've decided to build the functionality into the ChromiumWebBrowser.Partial.cs
  and will need to duplicate the functionality in CefSharp.Wpf.HwndHost. This guarantees that the
  Task will be resolved in all cases. The previous implementation there was a theoretical change we'd
  miss subscribing to the relevant events
- Remove CancellationToken as it's not possible to cancel

Issue #3842
2021-10-28 10:31:03 +10:00
Alex Maitland 91b7514a1c WinForms/WPF/OffScreen - Add WaitForBrowserInitialLoadAsync
Second attempt at WaitForBrowserInitialLoadAsync, includes optional
CancellationToken param.

Issue #3842
2021-10-27 13:58:57 +10:00
Alex Maitland 9993aa78e0 OffScreen - Create Browser when Global CefRequestContext initialized.
- GlobalContextInitialized wraps a TaskCompletionSource which is resolved
  when the Global CefRequestContext has been created
- Reduce code duplication

If successful we can apply the same changes to WinForms/WPF though they're less likely to have
issues than the OffScreen implementation as the CreateBrowser doesn't happen until much later

Issue #3850 #3634
2021-10-26 14:31:10 +10:00
Alex Maitland 1524482ede Core - Add Cef.InitializeAsync
- InitializeAsyncBrowserProcessHandler is used to complete the taskCompletionSource
  when OnContextInitialized is called
- Update the OffScreen example to be async with a simply SingleThreadSynchronizationContext
  to ensure we continue on our main thread.

Issue #3634
2021-10-22 20:10:38 +10:00
Alex Maitland 0e242a8706 Upgrade to CEF 95.7.10+g00d4ad5+chromium-95.0.4638.54 / Chromium 95.0.4638.54
Remove CefBrowserSettings.universal_access_from_file_urls and CefBrowserSettings.file_access_from_file_urls.
https://bitbucket.org/chromiumembedded/cef/commits/ff33d7f72144

Remove CefBrowserSettings.application_cache
https://bitbucket.org/chromiumembedded/cef/commits/370a7749e950ef6784c29a666d07a0b67148dd5f

Remove ignore_certificate_errors setting
https://bitbucket.org/chromiumembedded/cef/commits/aabe4ce466766f8bd9907e7fa30546a3afada214

RequestContextSettings.IgnoreCertificateErrors was removed, the CefSettings.IgnoreCertificateErrors property
now set the command line arg

Use CefRect for CefWindowInfo bounds
https://bitbucket.org/chromiumembedded/cef/commits/8587cc4e4bbc187aa989152e521318818b3f41d3

Additional overload has been added to pass in a Rect directly to SetAsChild

Rename SendFocusEvent to SetFocus
https://bitbucket.org/chromiumembedded/cef/commits/49a4611e28d7bbc221cff816d7c4a96c55ba2721

SendFocusEvent will now call SetFocus internally, the project internally has been updated to use SetFocus for WPF

Replace CefRequestCallback with CefCallback
https://bitbucket.org/chromiumembedded/cef/commits/3e7f1bb529442a6c7674262d9219df57964e9524

No changes to the API for this, I've kept the same interface and just mapped internally

Resolves #3857, #3667, #3668
2021-10-22 14:45:12 +10:00
Alex Maitland 67a08c47ee BrowserSubProcess/Examples/Tests - Migrate to newer SDK Style projects
- Migrate to new SDK style projects
- Migrate to chromiumembeddedframework.runtime packages
- Remove old packages.config files
- Update post build event for BrowserSubprocess to set TSAware/LargeAddressAware
- Change project build order

Issue #3706
2021-10-12 19:48:11 +10:00
Alex Maitland 544abc68d1 Revert "WinForms/WPF/OffScreen - Add WaitForBrowserInitialLoadAsync"
Tests started failing so will revisit later.

This reverts commit 08e5140060.
2021-10-11 10:14:31 +10:00
Alex Maitland 08e5140060 WinForms/WPF/OffScreen - Add WaitForBrowserInitialLoadAsync
Change all the tests to use WaitForBrowserInitialLoadAsync instead of LoadUrlAsync
as LoadUrlAsync will require a Url as part of #3842
2021-10-10 14:41:04 +10:00
campersau 5fed32012a Core - Ignore netcore output in netframework projects (#3828) 2021-09-25 21:09:01 +10:00
Alex Maitland 65534275b7 Core - Upgrade to newer SDK Style project
- Upgrade CefSharp.Core.csproj
- Upgrade CefSharp.csproj
- Ensure pdbs are generated for release builds with same settings as before

Issue #3791
2021-09-20 11:32:14 +10:00
Alex Maitland c5ba1ce430 Core - Add Cef.ParseUrl
Uses GURL to parse the Url (Google's URL parsing library)
2021-09-16 10:05:34 +10:00
Alex Maitland 172ee5afe8 Migrate from GitLink to Source link
Resolves #3036
2021-09-07 12:08:56 +10:00
Alex Maitland dcfce1b5d4 Core - Update CefSettings.UserDataPath xml doc
Updated to reflect Widevide CDM changes

Issue #3767
2021-09-05 14:23:21 +10:00
campersau 449cb30b0b AppVeyor - Build both solutions and use dotnet test 2021-09-03 10:53:28 +10:00
Alex Maitland d350cad52a Update to M93 (#3781)
* Upgrade to CEF 93.1.7+g9117d6a+chromium-93.0.4577.42 / Chromium 93.0.4577.42

- Core - Add basic ref counting implementation

IMPLEMENT_REFCOUNTING implementation uses atomic which
forces the VC++ compiler to compile as native which doesn't work for our managed ref classes.

    - Use InterlockedCompareExchange for custom ref count reads
    - Use InterlockedIncrement/InterlockedDecrement directly
    - There's no memory barrier for HasOneRef/HasAtLeastOneRef as the read of a LONG should happen in one operation
on 32/64 bit architectures (at least that's my understanding at this point in time).

    References:
    https://github.com/chromiumembedded/cef/blob/4472/include/base/internal/cef_atomicops_x86_msvc.h#L125
    https://github.com/chromiumembedded/cef/blob/4472/include/base/internal/cef_atomicops_arm64_msvc.h#L107
    https://github.com/chromiumembedded/cef/blob/4472/include/base/cef_atomic_ref_count.h#L114
    https://github.com/chromiumembedded/cef/blob/4472/include/cef_base.h#L91

-  Remove Microsoft.Net.Compilers package from projects
Now that we require a min of VS2019 to build there's no need for a custom compiler package
- Start removing VS2015/VC++2015 references
- Remove RegisterWidevineCdm
This is a breaking change. CEF will now automatically download the Widevine CDM component
Resolves #3767

- RequestContext.LoadExtension now uses managed to code spawn on CEF UI Thread
Avoid having to use cef_callback.h which was causing problems for x86 builds
2021-09-03 10:51:18 +10:00
Jozef Izso 5d14f7c159 Add property Cef.IsShutdown to allow checks for the shutdown state of Cef runtime (#3782) (#3783) 2021-08-31 07:15:55 +10:00
Alex Maitland e03b166c0c .Net Core/.Net 5 - Module Initializer When CurrentFolder IsNullOrEmpty use AppContext.BaseDirectory
Resolves #3772
2021-08-25 09:58:03 +10:00
Alex Maitland bec06b2495 Add Fluent DownloadHandler (#3576)
* Core - Add Fluent DownloadHandler implementation and IFrame.DownloadUrlAsync

Resolves #3550
2021-06-01 13:34:21 +10:00
Alex Maitland f4dc756597 Net Core - ModuleInitializer add null check for Assembly.Location
In .NET 5.0 and later versions, for bundled assemblies, Assembly.Location is an empty string.
https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.location?view=net-5.0
Which results in Path.GetDirectoryName returning null, in that case use use AppContext.BaseDirectory
otherwise Path.Combine will throw an exception.
In .NET 5.0 and later versions, for bundled assemblies, AppContext.BaseDirectory returns the containing directory of the host executable.
https://docs.microsoft.com/en-us/dotnet/api/system.appcontext.basedirectory?view=net-5.0

Related discussion https://github.com/cefsharp/CefSharp/discussions/3533
2021-05-01 16:11:51 +10:00
Alex Maitland 09652614bd Rename CefSettings.ProductVersion to CefSettings.UserAgentProduct
This is a breaking change.

Resolves #3530
2021-04-30 11:39:09 +10:00
Alex Maitland 191d13bba1 Core - Make ModuleInitializerAttribute internal
Issue #3519
2021-04-23 16:12:00 +10:00
Alex Maitland 6ea5ac49c8 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-13 15:10:38 +10:00
Alex Maitland 94fb45766d CefSettings - **EXPERIMENTAL** Add ChromeRuntime
https://bitbucket.org/chromiumembedded/cef/issues/2969/support-chrome-windows-with-cef-callbacks
2021-04-08 12:59:19 +10:00
Alex Maitland fdea682b3f Core - Add IRequestContext.IsDisposed 2021-04-06 16:39:09 +10:00
Konstantin Preißer 462bc747bd Add support for Windows ARM64 to CefSharp.NETCore packages (#3359)
* Add support for Windows ARM64 for the NETCore packages.

Note: .NET 5.0 or higher is required to build a WinForms/WPF application for win-arm64.

Fixes cefsharp/CefSharp#2944

* PR feedback: Remove "WIN32" define as it is already defined by minwindef.h.

* PR feedback: Switch the CefSharp.*.Example.netcore and CefSharp.Test.netcore projects from cef.redist to chromiumembeddedframework.runtime.

Note: These projects are excluded for build when platform is 'arm64', as otherwise the build fails as WinForms and WPF are not yet available for ARM64 in .NET 5.0.

* Follow-Up: Update path to CefSharp.Test.dll.

* PR feedback: Also use RuntimeInformation for the .NET Framework example projects.

* PR feedback:
- Remove copying of CefRedist files in CefSharp.AfterBuild.targets which is no longer needed.
- Update .vsconfig to include the VC ARM64 build tools.
2021-04-01 17:27:48 +10:00
Alex Maitland 36de22502c Net Core - Assembly.GetEntryAssembly can return null when loaded from an unmanaged application
- Add null check and use currently assembly location to resolve libcef.dll

The GetEntryAssembly method can return null when a managed assembly has been loaded from an unmanaged application.
https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.getentryassembly?view=net-5.0
2021-04-01 16:54:19 +10:00
Alex Maitland 223af40803 Core - Remove IBrowserSettings.WebSecurity
Web Security can be disabled via the "disable-web-security" command-line switch.

This is a breaking change.

Resolves #3312
2021-03-27 13:05:06 +10:00
Alex Maitland 5780aefda3 Net Source - Add SourceLink support
- The Debug PDBs will now use SourceLink
- The C++/CLI projects will use SourceLink
- CefSharp.Core.dll now generates/uses a ref assembly
- The managed (c#) projects still embed sources/symbols for Release builds

At some point we should investigate generating a snupkg to reduce the dll size
2021-03-12 13:15:31 +10:00
Alex Maitland c8968d46b7 Core - Remove RefAssembly Generation from Net452 packages
- They're not generated under VS2015 (AppVeyor) so didn't end up using them
2021-03-11 15:22:25 +10:00
Alex Maitland 6ea651bf55 BrowserSubprocess - Update SelfHost example 2021-02-21 19:47:59 +10:00
Alex Maitland b4e189bf4f Core - Add Cef.GetMinLogLevel()
Gets the current log level
2021-01-27 13:39:04 +10:00
Alex Maitland 497e75c267 Test - Add CanLoadRequestWithPostData test 2021-01-15 13:40:37 +10:00
Alex Maitland 12e583d2ef Core - PublicApi remove references to CefSharp.Core.Runtime
- Add an UnWrap method to the interfaces (should be hidden from IntelliSense)
- For .Net 4.5.2 projects they're  not a decorator class which an inner instance of the CefSharp.Core.Runtime Type
- For Net Core we have a ref assembly which allows us to reference the CefSharp.Core.Runtime without issues
  We can potentially remove the ref assembly now and forgo any direct reference.
2021-01-13 16:56:57 +10:00
Alex Maitland 66228eb429 Core - Make ObjectFactory types readonly
https://github.com/cefsharp/CefSharp/commit/66c95bc4997d11f212a756ed8b203e93408fe74e#r45840060
2021-01-12 10:53:13 +10:00
Alex Maitland 83d960e5cf Net Core - Fix BrowserSubProcess.SelfHost path lookup
- Add Initializer.BrowserSubProcessCorePath which is calculated the same as BrowserSubProcessPath
- Update SelfHost to use new path then fallback to old path.

Details in https://github.com/cefsharp/CefSharp/issues/3197#issuecomment-757819840
2021-01-12 10:49:07 +10:00
Alex Maitland 2a80b71161 WinForms/WPF - Fix BrowserSettings/RequestContext type checking
- When settings BrowserSettings/RequestContext properties the type checking needs to make sure the
CefSharp.Core.BrowserSettings and CefSharp.BrowserSettings objects are acceptable
- In WPF only the RequestContext was updated as there's no check for BrowserSettings property yet (probably should be)

https://github.com/cefsharp/CefSharp/issues/3343#issuecomment-757581368
2021-01-11 20:29:54 +10:00
Alex Maitland 56afee5c09 Net Core - CefSettingsBase add missing namespace qualifier 2021-01-11 14:47:00 +10:00
Alex Maitland 8858365c16 Core - Split PublicApi.cs out into separate classes
Issue #3319
2021-01-11 10:47:57 +10:00
Alex Maitland 02d045832b Core - CefSettings no longer implements IDisposable
**This is a breaking change**

- CefSharp.Core.CefSettingsBase is now disposed when calling Cef.Initialize
- CefSharpApp was refactored to no longer need a reference to CefSettingsBase so it can be disposed

Resolves #3220
2020-12-31 17:08:08 +10:00
Alex Maitland 8a367fbdc4 Refactor CefSharp.Core into CefSharp.Core.Runtime (#3311)
* Net Core - Rename CefSharp.Core.dll to CefSharp.Core.Runtime.dll

Partial rename, only Net Core, folder not renamed

* Net Core - Rename CefSharp.Core.RefAssembly to CefSharp.Core.netcore

Remove GenApi

* Core - Rename CefDragDataWrapper to DragData

Move into CefSharp.Core namespace

* WinForms/WPF/OffScreen - Migrate from GitLink command line to Nuget package

* Net Core - Refactor to have CefSharp.Core.dll contain only public Api

* Net Core - Remove CefSharp.Core.RefAssembly

* Net Core - Change CefSharp.Core.netcore output folder

* Net Core - Restructure nuget packages

* Net Core - Add Cefsharp.Core.Runtime.RefAssembly

* Net Core - Hide CLI/C++ classes from intellisense

Make sure users don't attempt to load them directly

* Rename CefSharp.Core to CefSharp.Core.Runtime

* Core - Restructure Net 4.5.2 packages to use CefSharp.Core.dll anycpu variant

Attempt to load CefSharp.Core.Runtime at runtime rather than having to use msbuild to copy the correct version

* Rename CefSharp.Core.netcore to CefSharp.Core

* WPF/WinForms/OffScreen - Change from x86/64 to AnyCPU

As they are all managed assemblies they can target AnyCPU.
Includes CefSharp.dll

* Convert RequestContextBuilder from C++ to C#

Now part of the CefSharp.Core PublicApi

* Update version number to 87.1.11

* Migrate more of the public Api to C#

* Net Core - Basic restructure complete

* Net Core - ModuleInitializer (Doesn't work yet)

* Remove direct references to BrowserSettings

* Net Core - ModuleInitializer load CefShar.Core.Runtime.dl

* Net Core - Load libcef.dll via CLR Module initializer

If no RID is specified then we can load libcef.dll using the module initializer

* Add version to CefSharp.Core

* Remove dependency on CefSharp.Core.Runtime
Rewrite common targets

* AnyCPU app.config transform

Improve AnyCPU support

* Improve Net Core 3 support
Only delete CefSharp.Core.Runtime.dll when AnyCPU

* Nuget - Add CefSharp.Core.Runtime reference when TargetFramework = NetCore

* Fix Typos

Based on #3306

* Net Core - Rename CefSharp.Core.Runtime RefAssembly source file

* Net Full - Generate CefSharp.Core.Runtime Ref Assembly

For now the powershell build script generates the .cs file based on a x86 release build.ps1
It's not possible to directly install GenApi as it requires a Sdk style project

* Net Core - Old packages copy files to required folders

* Test - Install newer .Net Compiler and set Lang Version to 7.3

* Net Core - Exclude Net 452 Runtime generated reference source

* Core - Add Refactoring TODO

* Ref Assembly - Generate source as part of build

- Move ref assembly source generate into GenerateRefAssemblySource.ps1
- Call before project build

Runs locally, see if Appveyor has a problem with the powershell script execution

* Core - Add more factory methods to create instances of managed wrappers

* Net Core - Make Initialzier properties internal

Not quite sure what the public API should look like as yet, so making internal for now.
2020-12-16 10:47:34 +10:00
Alex Maitland 6daf660caf Upgrade to 87.1.12+g03f9336+chromium-87.0.4280.88 / Chromium 87.0.4280.88 2020-12-11 11:19:02 +10:00
GitHubPang 6258b86059 Fix typos (#3306)
* Fix typos in md files in .github

* Fix typos in Cef.h
2020-12-08 09:08:18 +10:00
Alex Maitland a84d6e0958 Upgrade to CEF 87.1.11+g8bb7705+chromium-87.0.4280.66 / Chromium 87.0.4280.66 2020-11-29 17:58:59 +10:00
Alex Maitland f1daac7131 Core - Add IResponse.SetHeaderByName/GetHeaderByName 2020-11-26 16:43:16 +10:00