diff --git a/cmake/FindCEF.cmake b/cmake/FindCEF.cmake index 04ae5bdc9..1aec43fd0 100644 --- a/cmake/FindCEF.cmake +++ b/cmake/FindCEF.cmake @@ -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 diff --git a/make_externals.bat b/make_externals.bat index 26bea4836..2cfe37945 100644 --- a/make_externals.bat +++ b/make_externals.bat @@ -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 ( diff --git a/make_externals.sh b/make_externals.sh index 47b16dd7e..8baeb529f 100755 --- a/make_externals.sh +++ b/make_externals.sh @@ -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 diff --git a/plugins/csp-measurement-tools/src/FlagTool.cpp b/plugins/csp-measurement-tools/src/FlagTool.cpp index 99d19e852..bdb780ae6 100644 --- a/plugins/csp-measurement-tools/src/FlagTool.cpp +++ b/plugins/csp-measurement-tools/src/FlagTool.cpp @@ -32,8 +32,8 @@ FlagTool::FlagTool(std::shared_ptr pInputManager, : Mark(std::move(pInputManager), std::move(pSolarSystem), std::move(settings), std::move(objectName)) , mGuiArea(std::make_unique(600, 400)) - , mGuiItem(std::make_unique( - "file://{toolZoom}../share/resources/gui/flag.html", true)) { + , mGuiItem( + std::make_unique("file://{toolZoom}../share/resources/gui/flag.html")) { auto* pSG = GetVistaSystem()->GetGraphicsManager()->GetSceneGraph(); mGuiTransform.reset(pSG->NewTransformNode(mTransform.get())); diff --git a/plugins/csp-timings/src/Plugin.cpp b/plugins/csp-timings/src/Plugin.cpp index 56dbc9b19..a8adca864 100644 --- a/plugins/csp-timings/src/Plugin.cpp +++ b/plugins/csp-timings/src/Plugin.cpp @@ -42,8 +42,8 @@ void Plugin::init() { // documentation of cs::gui::WebView::setZoomLevel in great detail. This also means that all other // WebViews with an URL starting with "file://{mainUIZoom}../" will be automatically affected by // the pMainUIScale factor. - mGuiItem = std::make_unique( - "file://{mainUIZoom}../share/resources/gui/timings.html", false); + mGuiItem = + std::make_unique("file://{mainUIZoom}../share/resources/gui/timings.html"); // Configure the positioning and attributes of the statistics GUI item. mGuiItem->setSizeX(500); diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index 07273cb4e..49714417e 100644 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -24,7 +24,6 @@ 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 @@ -32,7 +31,6 @@ else() "${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() diff --git a/src/cs-core/GuiManager.cpp b/src/cs-core/GuiManager.cpp index 9b23cf821..50f823a7e 100644 --- a/src/cs-core/GuiManager.cpp +++ b/src/cs-core/GuiManager.cpp @@ -111,8 +111,8 @@ GuiManager::GuiManager( // documentation of cs::gui::WebView::setZoomLevel in great detail. This also means that all other // WebViews with an URL starting with "file://{mainUIZoom}../" will be automatically affected by // the pMainUIScale factor. - mCosmoScoutGui = std::make_unique( - "file://{mainUIZoom}../share/resources/gui/cosmoscout.html", true); + mCosmoScoutGui = + std::make_unique("file://{mainUIZoom}../share/resources/gui/cosmoscout.html"); // Usually, all GuiItems are attached to the global world-space GuiArea if it is // available. If not, they are added to the local screen-space GuiArea. diff --git a/src/cs-gui/GuiItem.cpp b/src/cs-gui/GuiItem.cpp index d5716078d..e1814f5bb 100644 --- a/src/cs-gui/GuiItem.cpp +++ b/src/cs-gui/GuiItem.cpp @@ -15,8 +15,8 @@ namespace cs::gui { //////////////////////////////////////////////////////////////////////////////////////////////////// -GuiItem::GuiItem(std::string const& url, bool allowLocalFileAccess) - : WebView(url, 100, 100, allowLocalFileAccess) +GuiItem::GuiItem(std::string const& url) + : WebView(url, 100, 100) , mAreaWidth(1) , mAreaHeight(1) , mSizeX(0) diff --git a/src/cs-gui/GuiItem.hpp b/src/cs-gui/GuiItem.hpp index 902dbc5f5..494654244 100644 --- a/src/cs-gui/GuiItem.hpp +++ b/src/cs-gui/GuiItem.hpp @@ -20,7 +20,7 @@ class CS_GUI_EXPORT GuiItem : public WebView { public: /// Creates a new GuiItem for the given page at the location of the URL. - explicit GuiItem(std::string const& url, bool allowLocalFileAccess = false); + explicit GuiItem(std::string const& url); GuiItem(GuiItem const& other) = delete; GuiItem(GuiItem&& other) = delete; diff --git a/src/cs-gui/WebView.cpp b/src/cs-gui/WebView.cpp index 86d0868ca..808d0e79d 100644 --- a/src/cs-gui/WebView.cpp +++ b/src/cs-gui/WebView.cpp @@ -23,13 +23,13 @@ class DevToolsClient : public CefClient { //////////////////////////////////////////////////////////////////////////////////////////////////// -WebView::WebView(const std::string& url, int width, int height, bool allowLocalFileAccess) +WebView::WebView(const std::string& url, int width, int height) : mClient(new detail::WebViewClient()) { 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); @@ -41,7 +41,6 @@ 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; mBrowser = CefBrowserHost::CreateBrowserSync(info, mClient, url, browserSettings, nullptr, nullptr); @@ -241,7 +240,7 @@ void WebView::redo() const { void WebView::injectFocusEvent(bool focus) { if (mInteractive) { - mBrowser->GetHost()->SendFocusEvent(focus); + mBrowser->GetHost()->SetFocus(focus); } } diff --git a/src/cs-gui/WebView.hpp b/src/cs-gui/WebView.hpp index f3dd519d8..57a5be047 100644 --- a/src/cs-gui/WebView.hpp +++ b/src/cs-gui/WebView.hpp @@ -31,7 +31,7 @@ namespace cs::gui { class CS_GUI_EXPORT WebView { public: /// Creates a new WebView for the given page at the location of the URL. - WebView(const std::string& url, int width, int height, bool allowLocalFileAccess = false); + WebView(const std::string& url, int width, int height); WebView(WebView const& other) = delete; WebView(WebView&& other) = delete; diff --git a/src/cs-gui/internal/RequestHandler.cpp b/src/cs-gui/internal/RequestHandler.cpp index 5b462e20a..c957798cd 100644 --- a/src/cs-gui/internal/RequestHandler.cpp +++ b/src/cs-gui/internal/RequestHandler.cpp @@ -15,11 +15,11 @@ namespace cs::gui::detail { bool RequestHandler::OnCertificateError(CefRefPtr /*browser*/, cef_errorcode_t /*cert_error*/, CefString const& /*request_url*/, - CefRefPtr /*ssl_info*/, CefRefPtr callback) { + CefRefPtr /*ssl_info*/, CefRefPtr callback) { logger().warn("Detected a certificate error in Chromium Embedded Framework. Continuing..."); - callback->Continue(true); + callback->Continue(); return true; } diff --git a/src/cs-gui/internal/RequestHandler.hpp b/src/cs-gui/internal/RequestHandler.hpp index 479a1cd05..4b2f16935 100644 --- a/src/cs-gui/internal/RequestHandler.hpp +++ b/src/cs-gui/internal/RequestHandler.hpp @@ -21,7 +21,7 @@ class RequestHandler : public CefRequestHandler { /// Implements to ignore certificate errors. bool OnCertificateError(CefRefPtr browser, cef_errorcode_t cert_error, CefString const& request_url, CefRefPtr ssl_info, - CefRefPtr callback) override; + CefRefPtr callback) override; CefRefPtr GetResourceRequestHandler(CefRefPtr /*browser*/, CefRefPtr /*frame*/, CefRefPtr /*request*/, bool /*is_navigation*/, diff --git a/src/cs-gui/internal/WebApp.cpp b/src/cs-gui/internal/WebApp.cpp index e32300470..4a3d50af5 100644 --- a/src/cs-gui/internal/WebApp.cpp +++ b/src/cs-gui/internal/WebApp.cpp @@ -35,6 +35,7 @@ void WebApp::OnBeforeCommandLineProcessing( if (process_type.empty()) { command_line->AppendSwitch("enable-overlay-scrollbar"); command_line->AppendSwitch("enable-begin-frame-scheduling"); + command_line->AppendSwitch("disable-web-security"); if (!mHardwareAccelerated) { command_line->AppendSwitch("disable-gpu");