diff --git a/src/shell/dotnet/Shell.sln.DotSettings b/src/shell/dotnet/Shell.sln.DotSettings index e3d9e1fe1..7b8137cc9 100644 --- a/src/shell/dotnet/Shell.sln.DotSettings +++ b/src/shell/dotnet/Shell.sln.DotSettings @@ -9,4 +9,5 @@ regarding copyright ownership. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions -and limitations under the License. \ No newline at end of file +and limitations under the License. + True \ No newline at end of file diff --git a/src/shell/dotnet/Shell/WebWindow.xaml.cs b/src/shell/dotnet/Shell/WebWindow.xaml.cs index 78a6ba9cc..7dfea0b2f 100644 --- a/src/shell/dotnet/Shell/WebWindow.xaml.cs +++ b/src/shell/dotnet/Shell/WebWindow.xaml.cs @@ -162,11 +162,20 @@ private Task InitializeCoreWebView2(CoreWebView2 coreWebView) { coreWebView.NewWindowRequested += (sender, args) => OnNewWindowRequested(args); coreWebView.WindowCloseRequested += (sender, args) => OnWindowCloseRequested(args); - coreWebView.NavigationStarting += (sender, args) => OnNavigationStarting(args); + coreWebView.NavigationStarting += (sender, args) => OnNavigationStarting(args); + coreWebView.DocumentTitleChanged += (sender, args) => OnDocumentTitleChanged(args); return Task.CompletedTask; } + private void OnDocumentTitleChanged(object args) + { + if (_options.Title == null) + { + Title = WebView.CoreWebView2.DocumentTitle; + } + } + private void OnNavigationStarting(CoreWebView2NavigationStartingEventArgs args) { if (_scriptsInjected) diff --git a/src/shell/dotnet/Shell/WebWindowOptions.cs b/src/shell/dotnet/Shell/WebWindowOptions.cs index fee994174..b51a7f278 100644 --- a/src/shell/dotnet/Shell/WebWindowOptions.cs +++ b/src/shell/dotnet/Shell/WebWindowOptions.cs @@ -34,7 +34,7 @@ public sealed class WebWindowOptions public double? Width { get; set; } public const double DefaultHeight = 450; - public const string DefaultTitle = "Compose Web Container"; + public const string DefaultTitle = "ComposeUI Web Container"; public const string DefaultUrl = "about:blank"; public const double DefaultWidth = 800; public const string ParameterName = nameof(WebWindowOptions);