public void Initialize()
        {
            Browser = _chromiumWebBrowser;

            var knownGoodUrls    = ConfigurationHandler.Settings.GetOpenProjectInstances();
            var lastVisitedPage  = ConfigurationHandler.LastVisitedPage();
            var isWhiteListedUrl = knownGoodUrls.Any(goodUrl =>
                                                     lastVisitedPage.StartsWith(goodUrl, StringComparison.InvariantCultureIgnoreCase));

            Browser.Address =
                isWhiteListedUrl ? lastVisitedPage : EmbeddedLandingPageHandler.GetEmbeddedLandingPageIndexUrl();

            Browser.DownloadHandler = _downloadHandler;
            // This handles checking of valid urls, otherwise they're opened in
            // the system browser
            Browser.RequestHandler = _requestHandler;
            // This one prevents popups or additional browser windows
            Browser.LifeSpanHandler = _lifeSpanHandler;

            _javaScriptBridge.SetWebBrowser(Browser);

            Browser.LoadingStateChanged += (s, e) =>
            {
                if (!e.IsLoading) // Not loading means the load is complete
                {
                    Application.Current.Dispatcher.Invoke(async() => { await InitializeRevitBridgeIfNotPresentAsync(); });
                }
            };

            // Save all page changes, so that the user can resume to the same
            // page as last time she used the add-in.
            DependencyPropertyDescriptor
            .FromProperty(ChromiumWebBrowser.AddressProperty, typeof(ChromiumWebBrowser))
            .AddValueChanged(Browser, (s, e) =>
            {
                var newUrl = Browser.Address;
                // Don't save local file addresses such as the settings page.
                if (newUrl.StartsWith("http"))
                {
                    ConfigurationHandler.SaveLastVisitedPage(Browser.Address);
                }
            });

            if (!ConfigurationHandler.Settings.EnableDevelopmentTools)
            {
                return;
            }

            var devToolsEnabled = false;

            Browser.IsBrowserInitializedChanged += (s, e) =>
            {
                if (devToolsEnabled)
                {
                    return;
                }

                Browser.ShowDevTools();
                devToolsEnabled = true;
            };
        }
 private static string LandingIndexPageUrl() => EmbeddedLandingPageHandler.GetEmbeddedLandingPageIndexUrl();