private void OnFrameLoadEnd(object sender, FrameLoadEndEventArgs e) { if (e.Frame.IsMain) { ActionExtension.InvokeInMainThread(() => PageLoaded?.Invoke(this, new UrlEventArgs(AlterUrl(e.Url)))); } }
private void SubscribeToViewLoadedMessage() { MessagingCenter.Subscribe <ExtendedContentPage>(this, "PageLoaded", (sender) => { PageLoaded?.Invoke(sender, EventArgs.Empty); }); }
//*********************** //*** Build Page Area *** //*********************** /// <summary> /// Constructor that defines the driver for an instance of this page, /// defines the elements for this page, and launches the application. /// </summary> /// <param name="testClass"></param> public LoginPage(BaseTestClass testClass) { driver = testClass.getDriver(); addElements(); pageLoaded = new PageLoaded(this.driver); launchApplication(); }
private bool LoadFailedCallback(IntPtr webview, WebKitLoadEvent type, IntPtr failingUrl, IntPtr error, IntPtr userdata) { // this event is called when there is an error, immediately afterwards the LoadCallback is called with state Finished. // to indicate that there was an error and the PageLoaded event has been invoked, the loadEventHandled variable is set to true. loadEventHandled = true; PageLoaded?.Invoke(this, PageLoadEventArgs.Failed); return(false); }
private void Webview_NavigationCompleted(object?sender, CoreWebView2NavigationCompletedEventArgs e) { if (EnableDevTools) { webview.CoreWebView2.OpenDevToolsWindow(); } PageLoaded?.Invoke(this, new PageLoadEventArgs(lastNavigatedUri !, e.IsSuccess)); }
private async void Webview_NavigationCompleted(object sender, WebViewControlNavigationCompletedEventArgs e) { if (e.IsSuccess && !supportsInitializeScript) { string initScript = Resources.GetInitScript("Windows"); await ExecuteScriptAsync(initScript); } PageLoaded?.Invoke(this, new PageLoadEventArgs(e.Uri, e.IsSuccess)); }
#pragma warning restore 0618 public void LoadUrl(string url, string externalToken, PageLoaded loadedHandler) { PageLoadedHandler = loadedHandler; // if the url begins with this, we'll launch it in an external browser ExternalToken = externalToken; ProgressBar.Visibility = ViewStates.Visible; WebView.LoadUrl(url); }
private async void Webview_NavigationCompleted(object sender, WebViewControlNavigationCompletedEventArgs e) { if (e.IsSuccess && config.EnableScriptInterface) { string initScript = Resources.GetInitScript("Windows"); await ExecuteScriptAsync(initScript); } PageLoaded?.Invoke(this, PageLoadEventArgs.GetFor(e.IsSuccess)); }
private void OnNavigated(object sender, PageLoadedEventArgs e) { CommandManager.InvalidateRequerySuggested(); UrlTextBox.Text = e.Url; PageLoaded?.Invoke(this, new PageLoadedEventArgs(_something.GetUrl())); if (SaveKey != null && e.Url.StartsWith(@"http", StringComparison.OrdinalIgnoreCase)) { ValuesStorage.Set(SaveKey, e.Url); } }
private async void Webview_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { if (config.EnableScriptInterface) { string initScript = Resources.GetInitScript("Windows"); await ExecuteScriptAsync(initScript); } // TODO: figure out how to get success state PageLoaded?.Invoke(this, PageLoadEventArgs.Successful); }
private async void Webview_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { if (webview.ReadyState == WebBrowserReadyState.Complete) { string initScript = Resources.GetInitScript("Windows"); await ExecuteScriptAsync(initScript); // TODO: figure out how to get success state // it may require some ActiveX Voodoo: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.webbrowser.createsink PageLoaded?.Invoke(this, new PageLoadEventArgs(e.Url, true)); } }
public void LoadPage(KPage page) { this.page?.OnHide(); this.page?.BackgroundImage?.UnloadGPU(); this.page?.RemoveSelectionChangedEventHandler(); this.page = page; this.page.OnShow(this); //ResetTransformation(true); RefreshPage(); this.page.SelectionChanged += Page_SelectionChanged; PageLoaded?.Invoke(this, page); }
/// <summary> /// Метод обрабатывающий загрузку страницы /// </summary> /// <param name="pageHtml">Код загруженной страницы</param> /// <param name="pageUrl">Адрес страницы</param> private void OnPageLoaded(string pageHtml, string pageUrl) { TotalPages = GetPagesCount(pageHtml); CurrentPage = GetCurrentPage(pageHtml); var totalAnnonces = GetAnnonceCount(pageHtml); PageLoaded?.Invoke(this, new PageLoadedEventArgs(CurrentPage, TotalPages, totalAnnonces)); if (CurrentPage < TotalPages) { LoadPage(GetNextPageUrl(pageUrl)); } }
async Task Load() { OnBeginLoading(); while (nextPage <= loadTo && !disposed) { await LoadNextPage().ConfigureAwait(false); PageLoaded?.Invoke(this, EventArgs.Empty); } OnEndLoading(); }
void OnDocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { if (e.Url.AbsolutePath != Url.AbsolutePath) { return; } if (skip) { skip = false; return; } PageLoaded?.Invoke(this, e); }
private async Task InitializePage() { //enables events. await internalSession.Page.Enable(); await Task.Delay(100); internalSession.Page.SubscribeToLoadEventFiredEvent((evt) => { //this should trigger when a page loads. PageLoaded?.Invoke(this, evt.Timestamp); }); }
/// <summary> /// Verifies successful login /// </summary> /// <returns>Boolean true if successful, false otherwise</returns> private Boolean verifySucessfulLogin() { PageLoaded pl = new PageLoaded(); pl.isDomComplete(driver); Boolean success = false; //If the page header contains "Welcome", then the application is deemed successfully logged into if (getText(elementDictionary["eleHomePageAllContentHeader"]).Contains("Welcome")) { success = true; } return(success); }
/*private void OnLoadCompleted(object sender, NavigationEventArgs e) { * Navigating?.Invoke(this, new PageLoadingEventArgs(AsyncProgressEntry.Ready, e.Uri.ToString())); * }*/ private void OnNavigated(object sender, WebBrowserNavigatedEventArgs args) { if (_inner == null || _inner.Url != args.Url) { return; } var userCss = _styleProvider?.ToScript(args.Url.OriginalString, false); if (userCss != null) { Execute(userCss); } PageLoaded?.Invoke(this, new UrlEventArgs(args.Url.ToString())); LoadingStateChanged?.Invoke(this, new PageLoadingEventArgs(AsyncProgressEntry.Ready, args.Url.ToString())); }
private async void LoadCallback(IntPtr webview, WebKitLoadEvent type, IntPtr userdata) { if (type == WebKitLoadEvent.Started) { loadEventHandled = false; } else if (type == WebKitLoadEvent.Finished && !loadEventHandled) { if (config.EnableScriptInterface) { string initScript = Resources.GetInitScript("Linux"); await ExecuteScriptAsync(initScript); } loadEventHandled = true; PageLoaded?.Invoke(this, PageLoadEventArgs.Successful); } }
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. public PunState() #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. { WordNetEngine = new Lazy <WordNetEngine>(() => new WordNetEngine()); PronunciationEngine = new Lazy <PronunciationEngine>(() => new PronunciationEngine()); var tasks = new List <Task>() { Task.Factory.StartNew(() => WordNetEngine.Value), Task.Factory.StartNew(() => PronunciationEngine.Value) }; _ = Task.WhenAll(tasks).ContinueWith(x => { EnginesLoaded = true; PageLoaded?.Invoke(null, EventArgs.Empty); }); }
private async void LoadCallback(IntPtr webview, WebKitLoadEvent type, IntPtr userdata) { if (type == WebKitLoadEvent.Started) { loadEventHandled = false; } // this callback gets called in this order: // Started: initially defined URL // Redirected (optional, multiple): new URL to which the redirect points // Committed: final URL that gets loaded, either initial URL or same as last redirect URL // Finished: same URL as committed, page has fully loaded if (type == WebKitLoadEvent.Started || type == WebKitLoadEvent.Redirected) { string url = GLibString.FromPointer(WebKit.GetCurrentUri(webview)); var args = new NavigatingEventArgs(new Uri(url)); Navigating?.Invoke(this, args); if (args.Cancel) { WebKit.StopLoading(webview); } } else if (type == WebKitLoadEvent.Finished && !loadEventHandled) { string initScript = Resources.GetInitScript("Linux"); await ExecuteScriptAsync(initScript); if (EnableDevTools) { ShowDevTools(); } loadEventHandled = true; string url = GLibString.FromPointer(WebKit.GetCurrentUri(webview)); PageLoaded?.Invoke(this, new PageLoadEventArgs(new Uri(url), true)); } }
//TODO: Make private if private callbacks are permitted https://github.com/aspnet/Blazor/issues/1218 public static void OnPageLoaded() { PageLoaded?.Invoke(null, EventArgs.Empty); }
private void LoadFailedCallback(IntPtr self, IntPtr op, IntPtr view, IntPtr navigation, IntPtr error) { PageLoaded?.Invoke(this, PageLoadEventArgs.Failed); }
private void LoadCallback(IntPtr self, IntPtr op, IntPtr view, IntPtr navigation) { PageLoaded?.Invoke(this, PageLoadEventArgs.Successful); }
public void _TriggerPageLoaded() { PageLoaded?.Invoke(this, EventArgs.Empty); }