Skip to content
Open
Show file tree
Hide file tree
Changes from 6 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
2 changes: 1 addition & 1 deletion cmake/FindCEF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ find_path(CEF_INCLUDE_DIR include/cef_version.h
HINTS ${CEF_ROOT_DIR}/include/cef)

# Locate library.
find_path(CEF_RESOURCE_DIR cef.pak
find_path(CEF_RESOURCE_DIR resources.pak chrome_100_percent.pak chrome_200_percent.pak
HINTS ${CEF_ROOT_DIR}/share/cef)

find_path(CEF_LIBRARY_DIR snapshot_blob.bin
Expand Down
5 changes: 3 additions & 2 deletions make_externals.bat
Original file line number Diff line number Diff line change
Expand Up @@ -386,12 +386,13 @@ echo.
echo Downloading, building and installing cef (this may take some time) ...
echo.

set CEF_DIR=cef_binary_88.1.6+g4fe33a1+chromium-88.0.4324.96_windows64_minimal
@REM WARNING: newer version of CEF require cmake > 3.19 (DLR provides 3.18.1)
set CEF_DIR=cef_binary_109.1.16+g454cbc2+chromium-109.0.5414.87_windows64_minimal

cmake -E make_directory "%BUILD_DIR%/cef/extracted" && cd "%BUILD_DIR%/cef"

IF NOT EXIST cef.tar (
curl.exe https://cef-builds.spotifycdn.com/cef_binary_88.1.6%%2Bg4fe33a1%%2Bchromium-88.0.4324.96_windows64_minimal.tar.bz2 --output cef.tar.bz2
curl.exe https://cef-builds.spotifycdn.com/cef_binary_109.1.16%%2Bg454cbc2%%2Bchromium-109.0.5414.87_windows64_minimal.tar.bz2 --output cef.tar.bz2
cd "%BUILD_DIR%/cef/extracted"
"%BUILD_DIR%/cef/bzip2/bin/bunzip2.exe" -v ../cef.tar.bz2
) else (
Expand Down
4 changes: 2 additions & 2 deletions make_externals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,10 @@ echo ""
echo "Downloading, building and installing cef ..."
echo ""

CEF_DIR=cef_binary_88.1.6+g4fe33a1+chromium-88.0.4324.96_linux64_minimal
CEF_DIR=cef_binary_109.1.16+g454cbc2+chromium-109.0.5414.87_linux64_minimal

cmake -E make_directory "$BUILD_DIR/cef/extracted" && cd "$BUILD_DIR/cef"
wget -nc https://cef-builds.spotifycdn.com/cef_binary_88.1.6%2Bg4fe33a1%2Bchromium-88.0.4324.96_linux64_minimal.tar.bz2
wget -nc https://cef-builds.spotifycdn.com/cef_binary_109.1.16%2Bg454cbc2%2Bchromium-109.0.5414.87_linux64_minimal.tar.bz2

cd "$BUILD_DIR/cef/extracted"
cmake -E tar xfj ../$CEF_DIR.tar.bz2
Expand Down
2 changes: 0 additions & 2 deletions resources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
"${CEF_LIBRARY_DIR}/chrome_elf.dll"
)
install(FILES ${CEF_RESOURCES} DESTINATION "bin")
install(DIRECTORY "${CEF_LIBRARY_DIR}/swiftshader" DESTINATION "bin")
install(DIRECTORY "${CEF_RESOURCE_DIR}/" DESTINATION "bin")
else()
set(CEF_RESOURCES
"${CEF_LIBRARY_DIR}/snapshot_blob.bin"
"${CEF_LIBRARY_DIR}/v8_context_snapshot.bin"
)
install(FILES ${CEF_RESOURCES} DESTINATION "lib")
install(DIRECTORY "${CEF_LIBRARY_DIR}/swiftshader/" DESTINATION "lib")
install(DIRECTORY "${CEF_RESOURCE_DIR}/" DESTINATION "lib" PATTERN "locales" EXCLUDE)
install(DIRECTORY "${CEF_RESOURCE_DIR}/locales" DESTINATION "bin")
endif()
Expand Down
8 changes: 4 additions & 4 deletions src/cs-gui/WebView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ WebView::WebView(const std::string& url, int width, int height, bool allowLocalF
WebView::resize(width, height);

CefWindowInfo info;
info.width = width;
info.height = height;
info.bounds.width = width;
info.bounds.height = height;

#ifdef _MSC_VER
info.SetAsWindowless(nullptr);
Expand All @@ -41,7 +41,7 @@ WebView::WebView(const std::string& url, int width, int height, bool allowLocalF

int const targetFrameRate = 60;
browserSettings.windowless_frame_rate = targetFrameRate;
browserSettings.web_security = allowLocalFileAccess ? STATE_DISABLED : STATE_ENABLED;
// browserSettings.web_security = allowLocalFileAccess ? STATE_DISABLED : STATE_ENABLED;

mBrowser =
CefBrowserHost::CreateBrowserSync(info, mClient, url, browserSettings, nullptr, nullptr);
Expand Down Expand Up @@ -241,7 +241,7 @@ void WebView::redo() const {

void WebView::injectFocusEvent(bool focus) {
if (mInteractive) {
mBrowser->GetHost()->SendFocusEvent(focus);
mBrowser->GetHost()->SetFocus(focus);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/cs-gui/internal/RequestHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ namespace cs::gui::detail {

bool RequestHandler::OnCertificateError(CefRefPtr<CefBrowser> /*browser*/,
cef_errorcode_t /*cert_error*/, CefString const& /*request_url*/,
CefRefPtr<CefSSLInfo> /*ssl_info*/, CefRefPtr<CefRequestCallback> callback) {
CefRefPtr<CefSSLInfo> /*ssl_info*/, CefRefPtr<CefCallback> callback) {

logger().warn("Detected a certificate error in Chromium Embedded Framework. Continuing...");

callback->Continue(true);
callback->Continue();
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/cs-gui/internal/RequestHandler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class RequestHandler : public CefRequestHandler {
/// Implements to ignore certificate errors.
bool OnCertificateError(CefRefPtr<CefBrowser> browser, cef_errorcode_t cert_error,
CefString const& request_url, CefRefPtr<CefSSLInfo> ssl_info,
CefRefPtr<CefRequestCallback> callback) override;
CefRefPtr<CefCallback> callback) override;

CefRefPtr<CefResourceRequestHandler> GetResourceRequestHandler(CefRefPtr<CefBrowser> /*browser*/,
CefRefPtr<CefFrame> /*frame*/, CefRefPtr<CefRequest> /*request*/, bool /*is_navigation*/,
Expand Down