Skip to content

Commit

Permalink
CefSharp updated
Browse files Browse the repository at this point in the history
  • Loading branch information
JosefNemec committed Aug 12, 2024
1 parent 665aad0 commit 4efc2fb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 22 deletions.
10 changes: 9 additions & 1 deletion source/Playnite/CefTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,22 @@ public static void ConfigureCef(bool enableLogs)
settings.CefCommandLineArgs.Add("disable-gpu", "1");
settings.CefCommandLineArgs.Add("disable-gpu-compositing", "1");

// This is because cookies created with Alloy runtime won't work with Chrome runtime
// which is default since CefSharp 126. Alloy will be completely removed from CEF 128
// so P10 will be likely stuck forever on 127.
// https://github.com/cefsharp/CefSharp/issues/4847
// https://github.com/chromiumembedded/cef/issues/3721
settings.ChromeRuntime = false;
CefSharpSettings.RuntimeStyle = CefRuntimeStyle.Alloy;

settings.CachePath = PlaynitePaths.BrowserCachePath;
settings.PersistSessionCookies = true;
settings.LogFile = Path.Combine(PlaynitePaths.ConfigRootPath, "cef.log");
settings.LogSeverity = enableLogs ? LogSeverity.Error : LogSeverity.Disable;
// Firefox user agent gives the best compatibility because some websites complain
// about unsecure browser if we try to pretend to be Chrome (which is CefSharp's default).
// Plugins can change this on an individual level anyways.
settings.UserAgent = $"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0 Playnite/{PlayniteApplication.CurrentVersion.ToString(2)}";
settings.UserAgent = $"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0 Playnite/{PlayniteApplication.CurrentVersion.ToString(2)}";
IsInitialized = Cef.Initialize(settings);
}

Expand Down
32 changes: 16 additions & 16 deletions source/Playnite/Playnite.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\CefSharp.Common.123.0.60\build\CefSharp.Common.props" Condition="Exists('..\packages\CefSharp.Common.123.0.60\build\CefSharp.Common.props')" />
<Import Project="..\packages\chromiumembeddedframework.runtime.win-x86.123.0.6\build\chromiumembeddedframework.runtime.win-x86.props" Condition="Exists('..\packages\chromiumembeddedframework.runtime.win-x86.123.0.6\build\chromiumembeddedframework.runtime.win-x86.props')" />
<Import Project="..\packages\chromiumembeddedframework.runtime.win-x64.123.0.6\build\chromiumembeddedframework.runtime.win-x64.props" Condition="Exists('..\packages\chromiumembeddedframework.runtime.win-x64.123.0.6\build\chromiumembeddedframework.runtime.win-x64.props')" />
<Import Project="..\packages\CefSharp.Common.126.2.180\build\CefSharp.Common.props" Condition="Exists('..\packages\CefSharp.Common.126.2.180\build\CefSharp.Common.props')" />
<Import Project="..\packages\chromiumembeddedframework.runtime.win-x86.126.2.18\build\chromiumembeddedframework.runtime.win-x86.props" Condition="Exists('..\packages\chromiumembeddedframework.runtime.win-x86.126.2.18\build\chromiumembeddedframework.runtime.win-x86.props')" />
<Import Project="..\packages\chromiumembeddedframework.runtime.win-x64.126.2.18\build\chromiumembeddedframework.runtime.win-x64.props" Condition="Exists('..\packages\chromiumembeddedframework.runtime.win-x64.126.2.18\build\chromiumembeddedframework.runtime.win-x64.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
Expand Down Expand Up @@ -72,17 +72,17 @@
<HintPath>..\packages\AngleSharp.0.9.9\lib\net45\AngleSharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="CefSharp, Version=123.0.60.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
<HintPath>..\packages\CefSharp.Common.123.0.60\lib\net462\CefSharp.dll</HintPath>
<Reference Include="CefSharp, Version=126.2.180.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
<HintPath>..\packages\CefSharp.Common.126.2.180\lib\net462\CefSharp.dll</HintPath>
</Reference>
<Reference Include="CefSharp.Core, Version=123.0.60.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
<HintPath>..\packages\CefSharp.Common.123.0.60\lib\net462\CefSharp.Core.dll</HintPath>
<Reference Include="CefSharp.Core, Version=126.2.180.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
<HintPath>..\packages\CefSharp.Common.126.2.180\lib\net462\CefSharp.Core.dll</HintPath>
</Reference>
<Reference Include="CefSharp.OffScreen, Version=123.0.60.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
<HintPath>..\packages\CefSharp.OffScreen.123.0.60\lib\net462\CefSharp.OffScreen.dll</HintPath>
<Reference Include="CefSharp.OffScreen, Version=126.2.180.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
<HintPath>..\packages\CefSharp.OffScreen.126.2.180\lib\net462\CefSharp.OffScreen.dll</HintPath>
</Reference>
<Reference Include="CefSharp.Wpf, Version=123.0.60.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
<HintPath>..\packages\CefSharp.Wpf.123.0.60\lib\net462\CefSharp.Wpf.dll</HintPath>
<Reference Include="CefSharp.Wpf, Version=126.2.180.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138, processorArchitecture=MSIL">
<HintPath>..\packages\CefSharp.Wpf.126.2.180\lib\net462\CefSharp.Wpf.dll</HintPath>
</Reference>
<Reference Include="CommandLine, Version=2.8.0.0, Culture=neutral, PublicKeyToken=5a870481e358d379, processorArchitecture=MSIL">
<HintPath>..\packages\CommandLineParser.2.8.0\lib\net461\CommandLine.dll</HintPath>
Expand Down Expand Up @@ -801,12 +801,12 @@
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\chromiumembeddedframework.runtime.win-x64.123.0.6\build\chromiumembeddedframework.runtime.win-x64.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\chromiumembeddedframework.runtime.win-x64.123.0.6\build\chromiumembeddedframework.runtime.win-x64.props'))" />
<Error Condition="!Exists('..\packages\chromiumembeddedframework.runtime.win-x86.123.0.6\build\chromiumembeddedframework.runtime.win-x86.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\chromiumembeddedframework.runtime.win-x86.123.0.6\build\chromiumembeddedframework.runtime.win-x86.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Common.123.0.60\build\CefSharp.Common.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.123.0.60\build\CefSharp.Common.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Common.123.0.60\build\CefSharp.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.123.0.60\build\CefSharp.Common.targets'))" />
<Error Condition="!Exists('..\packages\chromiumembeddedframework.runtime.win-x64.126.2.18\build\chromiumembeddedframework.runtime.win-x64.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\chromiumembeddedframework.runtime.win-x64.126.2.18\build\chromiumembeddedframework.runtime.win-x64.props'))" />
<Error Condition="!Exists('..\packages\chromiumembeddedframework.runtime.win-x86.126.2.18\build\chromiumembeddedframework.runtime.win-x86.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\chromiumembeddedframework.runtime.win-x86.126.2.18\build\chromiumembeddedframework.runtime.win-x86.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Common.126.2.180\build\CefSharp.Common.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.126.2.180\build\CefSharp.Common.props'))" />
<Error Condition="!Exists('..\packages\CefSharp.Common.126.2.180\build\CefSharp.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CefSharp.Common.126.2.180\build\CefSharp.Common.targets'))" />
</Target>
<Import Project="..\packages\CefSharp.Common.123.0.60\build\CefSharp.Common.targets" Condition="Exists('..\packages\CefSharp.Common.123.0.60\build\CefSharp.Common.targets')" />
<Import Project="..\packages\CefSharp.Common.126.2.180\build\CefSharp.Common.targets" Condition="Exists('..\packages\CefSharp.Common.126.2.180\build\CefSharp.Common.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
10 changes: 5 additions & 5 deletions source/Playnite/packages.config
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AngleSharp" version="0.9.9" targetFramework="net452" />
<package id="CefSharp.Common" version="123.0.60" targetFramework="net462" />
<package id="CefSharp.OffScreen" version="123.0.60" targetFramework="net462" />
<package id="CefSharp.Wpf" version="123.0.60" targetFramework="net462" />
<package id="CefSharp.Common" version="126.2.180" targetFramework="net462" />
<package id="CefSharp.OffScreen" version="126.2.180" targetFramework="net462" />
<package id="CefSharp.Wpf" version="126.2.180" targetFramework="net462" />
<package id="CommandLineParser" version="2.8.0" targetFramework="net462" />
<package id="CommonServiceLocator" version="1.3" targetFramework="net462" />
<package id="Crc32.NET" version="1.2.0" targetFramework="net462" />
<package id="DynamicLanguageRuntime" version="1.2.1" targetFramework="net462" />
<package id="Expression.Blend.Sdk" version="1.0.2" targetFramework="net462" />
<package id="Flurl" version="2.7.1" targetFramework="net462" />
<package id="chromiumembeddedframework.runtime.win-x64" version="123.0.6" targetFramework="net462" />
<package id="chromiumembeddedframework.runtime.win-x86" version="123.0.6" targetFramework="net462" />
<package id="chromiumembeddedframework.runtime.win-x64" version="126.2.18" targetFramework="net462" />
<package id="chromiumembeddedframework.runtime.win-x86" version="126.2.18" targetFramework="net462" />
<package id="LiteDB" version="4.1.4" targetFramework="net462" />
<package id="Markdig" version="0.18.0" targetFramework="net462" />
<package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.39" targetFramework="net462" />
Expand Down

0 comments on commit 4efc2fb

Please sign in to comment.