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 {
3637constexpr 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+
824835bool Supported () {
836+ if (OptionWebviewLegacyEdge.value ()) {
837+ return false ;
838+ }
825839 auto version = LPWSTR (nullptr );
826840 const auto result = GetAvailableCoreWebView2BrowserVersionString (
827841 nullptr ,
0 commit comments