|
62 | 62 | #include "ScenarioVirtualHostMappingForPopUpWindow.h" |
63 | 63 | #include "ScenarioVirtualHostMappingForSW.h" |
64 | 64 | #include "ScenarioWebMessage.h" |
| 65 | +#include "ScenarioWebRtcUdpPortConfiguration.h" |
65 | 66 | #include "ScenarioWebViewEventMonitor.h" |
66 | 67 | #include "ScenarioWindowControlsOverlay.h" |
67 | 68 | #include "ScriptComponent.h" |
@@ -531,6 +532,11 @@ bool AppWindow::ExecuteWebViewCommands(WPARAM wParam, LPARAM lParam) |
531 | 532 | NewComponent<ScenarioWebMessage>(this); |
532 | 533 | return true; |
533 | 534 | } |
| 535 | + case IDM_SCENARIO_WEBRTC_UDP_PORT_CONFIGURATION: |
| 536 | + { |
| 537 | + NewComponent<ScenarioWebRtcUdpPortConfiguration>(this); |
| 538 | + return true; |
| 539 | + } |
534 | 540 | case IDM_SCENARIO_ADD_HOST_OBJECT: |
535 | 541 | { |
536 | 542 | NewComponent<ScenarioAddHostObject>(this); |
@@ -597,6 +603,21 @@ bool AppWindow::ExecuteWebViewCommands(WPARAM wParam, LPARAM lParam) |
597 | 603 | NewComponent<ScenarioExtensionsManagement>(this, true); |
598 | 604 | return true; |
599 | 605 | } |
| 606 | + case IDM_SCENARIO_DRAG_DROP_OVERRIDE: |
| 607 | + { |
| 608 | + if (m_dcompDevice || m_wincompCompositor) |
| 609 | + { |
| 610 | + NewComponent<ScenarioDragDropOverride>(this); |
| 611 | + } |
| 612 | + else |
| 613 | + { |
| 614 | + MessageBox( |
| 615 | + m_mainWindow, |
| 616 | + L"Drag and Drop Override is only supported in visual hosting mode", |
| 617 | + L"Drag and Drop Override", MB_OK); |
| 618 | + } |
| 619 | + return true; |
| 620 | + } |
600 | 621 | case IDM_SCENARIO_CUSTOM_SCHEME: |
601 | 622 | { |
602 | 623 | NewComponent<ScenarioCustomScheme>(this); |
@@ -1777,7 +1798,7 @@ void AppWindow::InitializeWebView() |
1777 | 1798 | args.append( |
1778 | 1799 | L"--enable-features=ThirdPartyStoragePartitioning,PartitionedCookies," |
1779 | 1800 | L"msPageInteractionManagerWebview2"); |
1780 | | - auto options = Microsoft::WRL::Make<CoreWebView2EnvironmentOptions>(); |
| 1801 | + auto options = Microsoft::WRL::Make<CoreWebView2ExperimentalEnvironmentOptions>(); |
1781 | 1802 | options->put_AdditionalBrowserArguments(args.c_str()); |
1782 | 1803 | CHECK_FAILURE( |
1783 | 1804 | options->put_AllowSingleSignOnUsingOSPrimaryAccount(m_AADSSOEnabled ? TRUE : FALSE)); |
@@ -1833,6 +1854,24 @@ void AppWindow::InitializeWebView() |
1833 | 1854 | CHECK_FAILURE(options8->put_ScrollBarStyle(style)); |
1834 | 1855 | } |
1835 | 1856 |
|
| 1857 | + Microsoft::WRL::ComPtr<ICoreWebView2ExperimentalEnvironmentOptions> optionsExperimental; |
| 1858 | + if (options.As(&optionsExperimental) == S_OK) |
| 1859 | + { |
| 1860 | + // Configure port ranges for WebRTC UDP traffic to work within enterprise firewalls |
| 1861 | + // Set UDP port range (example: 50000-55000 for enterprise environments) |
| 1862 | + const INT32 udpMin = 50000, udpMax = 55000; |
| 1863 | + |
| 1864 | + CHECK_FAILURE(optionsExperimental->SetAllowedPortRange( |
| 1865 | + COREWEBVIEW2_ALLOWED_PORT_RANGE_SCOPE_WEB_RTC, |
| 1866 | + COREWEBVIEW2_TRANSPORT_PROTOCOL_KIND_UDP, udpMin, udpMax)); |
| 1867 | + |
| 1868 | + // Get the configured port range |
| 1869 | + CHECK_FAILURE(optionsExperimental->GetEffectiveAllowedPortRange( |
| 1870 | + COREWEBVIEW2_ALLOWED_PORT_RANGE_SCOPE_WEB_RTC, |
| 1871 | + COREWEBVIEW2_TRANSPORT_PROTOCOL_KIND_UDP, &m_udpPortRange.minPort, |
| 1872 | + &m_udpPortRange.maxPort)); |
| 1873 | + } |
| 1874 | + |
1836 | 1875 | HRESULT hr = CreateCoreWebView2EnvironmentWithOptions( |
1837 | 1876 | subFolder, m_userDataFolder.c_str(), options.Get(), |
1838 | 1877 | Callback<ICoreWebView2CreateCoreWebView2EnvironmentCompletedHandler>( |
|
0 commit comments