Skip to content

Commit cc8f41d

Browse files
committed
Add webview-legacy-edge option.
1 parent cccc874 commit cc8f41d

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

webview/platform/win/webview_windows_edge_chromium.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "base/algorithm.h"
1212
#include "base/basic_types.h"
1313
#include "base/flat_map.h"
14+
#include "base/options.h"
1415
#include "base/variant.h"
1516
#include "base/weak_ptr.h"
1617
#include "base/platform/base_platform_info.h"
@@ -36,6 +37,14 @@ namespace {
3637
constexpr auto kDataUrlPrefix
3738
= std::string_view("http://desktop-app-resource/");
3839

40+
base::options::toggle OptionWebviewLegacyEdge({
41+
.id = kOptionWebviewLegacyEdge,
42+
.name = "Force legacy Edge WebView.",
43+
.description = "Skip modern CoreWebView2 check and force using legacy Edge WebView on Windows.",
44+
.scope = base::options::windows,
45+
.restartRequired = true,
46+
});
47+
3948
[[nodiscard]] std::wstring ToWide(std::string_view string) {
4049
const auto length = MultiByteToWideChar(
4150
CP_UTF8,
@@ -821,7 +830,12 @@ void Instance::setOpaqueBg(QColor opaqueBg) {
821830

822831
} // namespace
823832

833+
const char kOptionWebviewLegacyEdge[] = "webview-legacy-edge";
834+
824835
bool Supported() {
836+
if (OptionWebviewLegacyEdge.value()) {
837+
return false;
838+
}
825839
auto version = LPWSTR(nullptr);
826840
const auto result = GetAvailableCoreWebView2BrowserVersionString(
827841
nullptr,

webview/platform/win/webview_windows_edge_chromium.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
namespace Webview::EdgeChromium {
1212

13+
extern const char kOptionWebviewLegacyEdge[];
14+
1315
[[nodiscard]] bool Supported();
1416
[[nodiscard]] std::unique_ptr<Interface> CreateInstance(Config config);
1517

0 commit comments

Comments
 (0)