Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to .NET 6.0 and CEFSharp 106 #70

Merged
merged 4 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ Ctrl+F | Open search bar (Enter to find next, Esc to close)

- You need [VC++ 2019 Runtime](https://aka.ms/vs/17/release/vc_redist.x64.exe) 32-bit and 64-bit versions

- You need .NET Framework 4.8.
- You need .NET 6.

- You need to install the version of VC++ Runtime that CEFSharp needs. Since we are using CefSharp 104, according to [this](https://github.com/cefsharp/CefSharp/#release-branches) we need the above versions
- You need to install the version of VC++ Runtime that CEFSharp needs. Since we are using CefSharp 106, according to [this](https://github.com/cefsharp/CefSharp/#release-branches) we need the above versions


## Getting started
Expand All @@ -54,7 +54,7 @@ Ctrl+F | Open search bar (Enter to find next, Esc to close)

## Code

- SharpBrowser uses CefSharp 104 and is built on NET Framework 4.8
- SharpBrowser uses CefSharp 106 and is built on NET 6
- SharpBrowser supports AnyCPU as well as x86/x64 specific builds
- `MainForm.cs` - main web browser UI and related functionality
- `Handlers` - various handlers that we have registered with CefSharp that enable deeper integration between us and CefSharp
Expand Down
4 changes: 2 additions & 2 deletions src/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void InitTooltips(System.Windows.Forms.Control.ControlCollection parent)
private void InitBrowser() {

//CefSharpSettings.LegacyJavascriptBindingEnabled = true;
CefSharpSettings.WcfEnabled = false;

Cef.EnableHighDPISupport();
CefSettings settings = new CefSettings();

Expand Down Expand Up @@ -383,7 +383,7 @@ private BrowserTab AddNewBrowser(BrowserTabStripItem tabStrip, String url) {
tabStrip.Tag = tab;

if (url.StartsWith(BrowserConfig.InternalURL + ":")) {
browser.JavascriptObjectRepository.Register("host", host, true, BindingOptions.DefaultBinder);
browser.JavascriptObjectRepository.Register("host", host, BindingOptions.DefaultBinder);
}
return tab;
}
Expand Down
150 changes: 14 additions & 136 deletions src/SharpBrowser.csproj
Original file line number Diff line number Diff line change
@@ -1,60 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{703472B8-B275-4F3F-95B6-426036F8462E}</ProjectGuid>
<TargetFramework>net6.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SharpBrowser</RootNamespace>
<AssemblyName>SharpBrowser</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<CefSharpAnyCpuSupport>true</CefSharpAnyCpuSupport>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resources\sharpbrowser.ico</ApplicationIcon>
Expand All @@ -63,102 +17,26 @@
<StartupObject>SharpBrowser.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Compile Include="Browser\BrowserConfig.cs" />
<Compile Include="Browser\Model\BrowserHotKey.cs" />
<Compile Include="Browser\Model\BrowserTab.cs" />
<Compile Include="Data\JSON.cs" />
<Compile Include="Handlers\ResourceRequestHandler.cs" />
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="Controls\BrowserTabStrip\BaseStyledPanel.cs">
<Compile Update="Controls\BrowserTabStrip\BaseStyledPanel.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\BrowserTabStrip\Data\CollectionChange.cs" />
<Compile Include="Controls\BrowserTabStrip\Data\CollectionClear.cs" />
<Compile Include="Controls\BrowserTabStrip\Data\CollectionWithEvents.cs" />
<Compile Include="Controls\BrowserTabStrip\BrowserTabStrip.cs">
<Compile Update="Controls\BrowserTabStrip\BrowserTabStrip.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\BrowserTabStrip\BrowserTabStripCloseButton.cs" />
<Compile Include="Controls\BrowserTabStrip\BrowserTabStripItem.cs">
<Compile Update="Controls\BrowserTabStrip\BrowserTabStripItem.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\BrowserTabStrip\Enums\BrowserTabStripItemChangeTypes.cs" />
<Compile Include="Controls\BrowserTabStrip\Data\BrowserTabStripItemCollection.cs" />
<Compile Include="Controls\BrowserTabStrip\Enums\HitTestResult.cs" />
<Compile Include="Controls\BrowserTabStrip\Events\BrowserTabStripItemChangedEventArgs.cs" />
<Compile Include="Controls\BrowserTabStrip\Events\BrowserTabStripItemChangedHandler.cs" />
<Compile Include="Controls\BrowserTabStrip\Events\BrowserTabStripItemClosingEventArgs.cs" />
<Compile Include="Controls\BrowserTabStrip\Events\BrowserTabStripItemClosingHandler.cs" />
<Compile Include="Utils\MiscUtils.cs" />
<Compile Include="Handlers\HostHandler.cs" />
<Compile Include="Handlers\RequestHandler.cs" />
<Compile Include="Handlers\SchemeHandler.cs" />
<Compile Include="Handlers\SchemeHandlerFactory.cs" />
<Compile Include="Handlers\DownloadHandler.cs" />
<Compile Include="Handlers\KeyboardHandler.cs" />
<Compile Include="Handlers\LifeSpanHandler.cs" />
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Handlers\ContextMenuHandler.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utils\FileIconUtils.cs" />
<Compile Include="Utils\URLUtils.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\sharpbrowser.ico" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.XML" />
<PackageReference Include="CefSharp.Common" Version="106.0.260" />
<PackageReference Include="CefSharp.Common.NETCore" Version="106.0.260" />
<PackageReference Include="CefSharp.WinForms.NETCore" Version="106.0.260" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CefSharp.Common">
<Version>104.4.240</Version>
</PackageReference>
<PackageReference Include="CefSharp.WinForms">
<Version>104.4.240</Version>
</PackageReference>
<Reference Include="System.Net" />
<Reference Include="System.Web" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
24 changes: 19 additions & 5 deletions src/SharpBrowser.sln
Original file line number Diff line number Diff line change
@@ -1,28 +1,42 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
# Visual Studio Version 17
VisualStudioVersion = 17.3.32901.215
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpBrowser", "SharpBrowser.csproj", "{703472B8-B275-4F3F-95B6-426036F8462E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpBrowser", "SharpBrowser.csproj", "{703472B8-B275-4F3F-95B6-426036F8462E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{41B061E7-4B20-47D6-8B61-C022FA944C24}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{703472B8-B275-4F3F-95B6-426036F8462E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{703472B8-B275-4F3F-95B6-426036F8462E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{703472B8-B275-4F3F-95B6-426036F8462E}.Debug|x86.ActiveCfg = Debug|x86
{703472B8-B275-4F3F-95B6-426036F8462E}.Debug|x86.Build.0 = Debug|x86
{703472B8-B275-4F3F-95B6-426036F8462E}.Debug|x64.ActiveCfg = Debug|x64
{703472B8-B275-4F3F-95B6-426036F8462E}.Debug|x64.Build.0 = Debug|x64
{703472B8-B275-4F3F-95B6-426036F8462E}.Debug|x86.ActiveCfg = Debug|Any CPU
{703472B8-B275-4F3F-95B6-426036F8462E}.Debug|x86.Build.0 = Debug|Any CPU
{703472B8-B275-4F3F-95B6-426036F8462E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{703472B8-B275-4F3F-95B6-426036F8462E}.Release|Any CPU.Build.0 = Release|Any CPU
{703472B8-B275-4F3F-95B6-426036F8462E}.Release|x64.ActiveCfg = Release|x64
{703472B8-B275-4F3F-95B6-426036F8462E}.Release|x64.Build.0 = Release|x64
{703472B8-B275-4F3F-95B6-426036F8462E}.Release|x86.ActiveCfg = Release|x86
{703472B8-B275-4F3F-95B6-426036F8462E}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {565C1009-C43D-4D6E-996B-E4069AE8A18B}
EndGlobalSection
EndGlobal