示例#1
0
 private void OnFrameLoadStart(object sender, FrameLoadStartEventArgs e)
 {
     if (e.Frame.IsMain)
     {
         ActionExtension.InvokeInMainThread(() => PageLoadingStarted?.Invoke(this, new UrlEventArgs(e.Url ?? string.Empty)));
     }
 }
示例#2
0
 private void browser_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
 {
     if (e.Frame.IsMain && BrowserUtils.IsTwitterWebsite(e.Frame))
     {
         ScriptLoader.ExecuteFile(e.Frame, "twitter.js");
     }
 }
示例#3
0
        private void ChromiumWebBrowser_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
        {
            ConsoleLogger.Debug(nameof(ChromiumWebBrowser_FrameLoadStart) + " : " + new
            {
                e.TransitionType,
                e.Url,
            });

            Invoke(new Action(() =>
            {
                toolStripStatusLabel_loading.Text = $"{e.TransitionType} {e.Url}";
            }));

            foreach (ICrawlerPlugin plugin in CrawlerPlugins.Values)
            {
                try
                {
                    plugin.ChromiumWebBrowser_FrameLoadStart(sender, e);
                }
                catch (Exception ex)
                {
                    ConsoleLogger.Warn($"{plugin.Title}.{nameof(plugin.ChromiumWebBrowser_FrameLoadStart)} : {ex}");
                }
            }
        }
示例#4
0
        private void Browser_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
        {
            if (!e.Frame.IsMain)
            {
                return;
            }

            lastUrl = e.Url;

            if (_api != null)
            {
                var initScript = @"(async () => {
                    await CefSharp.BindObjectAsync('OverlayPluginApi');
                    OverlayPluginApi.overlayName = " + JsonConvert.SerializeObject(this.overlayName) + @";
                    OverlayPluginApi.overlayUuid = " + JsonConvert.SerializeObject(this.overlayUuid) + @";
                    OverlayPluginApi.ready = true;
                })();";
                e.Frame.ExecuteJavaScriptAsync(initScript, "init");
            }

            foreach (var item in this.scriptQueue)
            {
                e.Frame.ExecuteJavaScriptAsync(item, "injectOnLoad");
            }
            this.scriptQueue.Clear();

            try
            {
                BrowserStartLoading?.Invoke(this, new BrowserLoadEventArgs(0, e.Url));
            } catch (Exception ex)
            {
                BrowserConsoleLog?.Invoke(this, new BrowserConsoleLogEventArgs(ex.ToString(), "", 1));
            }
        }
 private void UiBrowser_OnFrameStartLoad(object arg1, FrameLoadStartEventArgs arg2)
 {
     //Wait for the MainFrame to finish loading
     if (arg2.Frame.IsMain)
     {
         arg2.Frame.ExecuteJavaScriptAsync("alert('MainFrame start loading');");
     }
 }
 private void Browser_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
 {
     window.Dispatcher.Invoke(() =>
     {
         var k = browser.Address;
         System.Diagnostics.Debug.WriteLine(k);
     });
 }
示例#7
0
 private void chromiumBrowser_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
 {
     siteLoad.Restart();
     Pic_load.Image    = Resources.cancel;
     siteLoading.Value = 40;
     Properties.Settings.Default.Charlie = Properties.Settings.Default.Charlie + 1;
     Properties.Settings.Default.Save();
 }
示例#8
0
        private void HandleBrowserFrameLoadStart(object?sender, FrameLoadStartEventArgs e)
        {
            var s = string.Format(Properties.Resources.LOADING_FRAME, e.Frame.Identifier);

            StatusEvent?.Invoke(this, new WebBrowserProgressEventArgs {
                Description = s
            });
        }
示例#9
0
 private void MWebBrowser_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
 {
     try
     {
         mIBrowser.MainFrame.EvaluateScriptAsync("Object.defineProperty(this,'navigator',{value :{platform :\"Android\"}});");
     }
     catch { }
 }
示例#10
0
 void ILoadHandler.OnFrameLoadStart(IWebBrowser chromiumWebBrowser, FrameLoadStartEventArgs frameLoadStartArgs)
 {
     try
     {
         chromiumWebBrowser.GetMainFrame().Browser.MainFrame.EvaluateScriptAsync("Object.defineProperty(this,'navigator',{value :{platform :\"Android\"}});");
     }
     catch { }
 }
示例#11
0
文件: MainForm.cs 项目: zedjia/Ber
 void browser_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
 {
     this.BeginInvoke(new Func <bool>(() =>
     {
         checkjQuery();
         return(true);
     }));
 }
示例#12
0
 private void OnFrameLoadStart(object sender, FrameLoadStartEventArgs e)
 {
     _inner.SetZoomLevel(Math.Log(_zoomLevel, 1.2));
     if (e.Frame.IsMain)
     {
         ActionExtension.InvokeInMainThread(() => PageLoadingStarted?.Invoke(this, new UrlEventArgs(AlterUrl(e.Url))));
     }
 }
示例#13
0
        private void OnFrameLoadStart(object sender, FrameLoadStartEventArgs e)
        {
            if (Debug)
            {
                DebugLog.Message("Frame.Name: " + e.Frame.Name);
            }

            return;
        }
示例#14
0
 /// <summary>
 /// The query results web browser_ on frame load start.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 private void QueryResultsWebBrowser_OnFrameLoadStart(object sender, FrameLoadStartEventArgs e)
 {
     this.Dispatcher.Invoke(
         delegate
     {
         this.queryResultsWebBrowser.Visibility = Visibility.Collapsed;
         LoadingTextBlock.Visibility            = Visibility.Visible;
     });
 }
示例#15
0
 private void BrowserSetup_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
 {
     Dispatcher.Invoke(() =>
     {
         this.BrowserSetup.SetZoomLevel(-2);
         this.Show();
         //this.BrowserSetup.ShowDevTools();
     });
 }
示例#16
0
 private void ChromiumWebBrowser_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
 {
     Console.WriteLine("started");
     this.Dispatcher.Invoke(() =>
     {
         loading.Visibility = Visibility.Visible;
         ImageBehavior.GetAnimationController(loading).Play();
     });
 }
示例#17
0
 private void OnFrameLoadStart(object sender, FrameLoadStartEventArgs e)
 {
     if (e.Frame.IsMain)
     {
         ActionExtension.InvokeInMainThreadAsync(() => {
             Navigating?.Invoke(this, PageLoadingEventArgs.Indetermitate);
         });
     }
 }
示例#18
0
        private void FrameLoadStart(object sender, FrameLoadStartEventArgs e)
        {
            var browser = (ChromiumWebBrowser)sender;

            if (e.Frame.IsMain)
            {
                SettingZoomLevel(this.Setting.ZoomLevel);
            }
        }
示例#19
0
        private void Browser_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
        {
            var w = sender as CustomChrominWebBrowser;

            if (w != null && w.ID != 0)
            {
                GetTaskViewModel(w);
            }
        }
示例#20
0
 private void RenderWebBrowserOnFrameLoadStart(object sender, FrameLoadStartEventArgs e)
 {
     _logger.LogDebug("Navigation started to url '{url}'", e.Frame.Url);
     if (Status == AppStatus.Authenticating && e.Frame.Url == SkypeWebAppUrl)
     {
         this.UpdateStatus(AppStatus.Authenticated);
         this.UpdateStatus(AppStatus.Loading);
     }
 }
示例#21
0
 private void WebView_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
 {
     Dispatcher.BeginInvoke((Action)(() =>
     {
         RefreshImage.Source = stopBtn;
         refreshing = true;
         startPage.Visibility = Visibility.Hidden;
     }));
 }
示例#22
0
 private void Cwb_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
 {
     if (e.Url == "https://www.patreon.com/home" || e.Url == "https://www.patreon.com/creator-home")
     {
         _cwb.Stop();
         _cwb.FrameLoadStart -= Cwb_FrameLoadStart;
         _cwb.Load("view-source:" + e.Url);
     }
 }
示例#23
0
        void IWebBrowserInternal.OnFrameLoadStart(FrameLoadStartEventArgs args)
        {
            var handler = FrameLoadStart;

            if (handler != null)
            {
                handler(this, args);
            }
        }
示例#24
0
        private void Browser_FrameLoadEnd(object sender, FrameLoadStartEventArgs e)
        {
            if (!GamePageLoaded)
                return;

            if (e.Frame.Name == "game_frame") {
                ApplyStyleSheet();
                DestroyDMMreloadDialog();
            }
        }
 private async void Browser_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
 {
     if (Cef.IsInitialized)
     {
         if (await Browser.GetZoomLevelAsync() != _zoomLvl)
         {
             zoomLvl = _zoomLvl;
         }
     }
 }
示例#26
0
文件: MainForm.cs 项目: zedjia/Ber
 void browser_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
 {
     if (showwaiteform)//我也搞不懂为什么这个start和end时间会进入两次所以做了这个标记
     {
         showwaiteform = false;
         this.BeginInvoke(new Func <bool>(() =>
         {
             return(true);
         }));
     }
 }
示例#27
0
 private void webClient_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
 {
     if (e.Url.Contains("#access_token="))
     {
         string[] _tokenSep = new string[] { "=", "&" };
         Libs.OAuth.OAuthToken = ((e.Url).Split(_tokenSep, StringSplitOptions.None)[1]);
     }
     else if (e.Url.Contains("?error="))
     {
         MessageBox.Show(e.Url);
     }
 }
示例#28
0
        //Если в таск листе что-то есть, то ставим хэндл на windows.onload
        private void Wb_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
        {
            var path = new Uri(e.Url).AbsolutePath;

            if (TaskList.ContainsKey(path))
            {
                string query = TaskList[path];
                query = "window.onload=function() {" + query + "   };";

                e.Frame.EvaluateScriptAsync(query);
                TaskList.Remove(path);
            }
        }
        private void WbControl_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
        {
            var path = new Uri(e.Url).PathAndQuery;

            if (_taskList.ContainsKey(path))
            {
                string query = _taskList[path];
                query = "document.addEventListener('DOMContentLoaded', DomLoad);  function DomLoad() {" + query + "};  ";

                e.Frame.EvaluateScriptAsync(query);
                _taskList.Remove(path);
            }
        }
示例#30
0
        /// <inheritdoc />
        protected override void OnFrameLoadStart(IWebBrowser chromiumWebBrowser, FrameLoadStartEventArgs args)
        {
            var browser = args.Browser;

            if (browser.IsPopup)
            {
                var control = ChromiumHostControl.FromBrowser(browser);

                control?.OnFrameLoadStart(args);
            }

            base.OnFrameLoadStart(chromiumWebBrowser, args);
        }
示例#31
0
 void IWebBrowserInternal.OnFrameLoadStart(FrameLoadStartEventArgs args)
 {
     var handler = FrameLoadStart;
     if (handler != null)
     {
         handler(this, args);
     }
 }