Skip to content

Commit

Permalink
Webview Version Update (#32)
Browse files Browse the repository at this point in the history
* Update weview versions

* Update README.md
  • Loading branch information
geaz authored Nov 24, 2023
1 parent 7c6ccf1 commit 3ce5623
Show file tree
Hide file tree
Showing 14 changed files with 31,329 additions and 10,362 deletions.
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ project(webview VERSION 0.10.0)
set(CMAKE_CXX_STANDARD 17)

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT -DWEBVIEW_STATIC")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd -DWEBVIEW_STATIC")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
find_package(PkgConfig REQUIRED)
pkg_check_modules(
Expand All @@ -16,15 +16,16 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
webkit2 REQUIRED webkit2gtk-4.0
IMPORTED_TARGET
)
set(CMAKE_CXX_FLAGS "-DWEBVIEW_STATIC")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -framework WebKit")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -framework WebKit -DWEBVIEW_STATIC")
endif()

include(FetchContent)
FetchContent_Declare(
webviewNative
GIT_REPOSITORY https://github.com/webview/webview
GIT_TAG 5d72732c9f5c94241d9a983b512e5fc5698bd1e0
GIT_TAG 53ea174ce79ca2f52e28dd51d49052aebce3f4c5
)
FetchContent_Populate(webviewNative)

Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ It uses Edge Chromium, with fallback to the 'old' Edge, on Windows, GTK Webkit o

You are always able to see which webview version *sharpWebview* uses by looking into the [CMakeLists.txt](https://github.com/webview/sharpWebview/blob/master/CMakeLists.txt) (GIT_TAG option in the *FetchContent_Declare* command). You can find all compiled libraries and used patches in the [libs](https://github.com/webview/sharpWebview/tree/master/libs) folder of this repository.

All patches are also contributed back to [webview](https://github.com/webview/webview).

# Get started

## Linux Prerequisites
Expand All @@ -28,6 +26,11 @@ With a distribution using apt run:
sudo apt install -y libwebkit2gtk-4.0-dev libgtk-3-dev
```

or DNF
```
sudo dnf install webkit2gtk4,0-devel.x86_64 gtk3-devel.x84_64
```

## A basic example

Create a new .net core console application and add the **SharpWebview** nuget. Use the dotnet command line or the package management in Visual Studio, if you use it.
Expand Down
2 changes: 1 addition & 1 deletion examples/DesktopApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static void Main(string[] args)
// Req contains the parameters of the javascript call
Console.WriteLine(req);
// And returns a successful promise result to the javascript function, which executed the 'evalTest'
webview.Return(id, RPCResult.Success, "{ result: 42 }");
webview.Return(id, RPCResult.Success, "{ \"result\": 42 }");
})
// Navigate to this url on start
.Navigate(hostedContent)
Expand Down
2 changes: 1 addition & 1 deletion examples/Minimal/Minimal.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SharpWebview" Version="0.7.0" />
<PackageReference Include="SharpWebview" Version="0.8.0" />
</ItemGroup>
<ItemGroup>
<None Update="icon.ico">
Expand Down
Binary file modified libs/WebView2Loader.dll
Binary file not shown.
Binary file modified libs/WebView2Loader.dll.lib
Binary file not shown.
Binary file modified libs/WebView2LoaderStatic.lib
Binary file not shown.
Loading

0 comments on commit 3ce5623

Please sign in to comment.