Пример #1
0
 private void CoreWebView2_DOMContentLoaded(object sender, CoreWebView2DOMContentLoadedEventArgs e)
 {
     if (ページが読み込まれた != null)
     {
         ページが読み込まれた(sender, e);
     }
 }
Пример #2
0
 private void CoreWebView2_DOMContentLoaded(object sender, CoreWebView2DOMContentLoadedEventArgs e)
 {
     if (LoadCompleted != null && this._info != null)
     {
         this._info.BrowserMilliseconds = this._urlWatch.ElapsedMilliseconds;
         this._info.BrowserName         = this.webBrowser1.Visible ? "WebBrowser" : "WebView2";
         LoadCompleted(this, this._info);
     }
 }
Пример #3
0
 private void CoreWebView2_DOMContentLoaded(object sender, CoreWebView2DOMContentLoadedEventArgs e)
 {
     Console.WriteLine("Se ha cargado");
     this.Text = "" + this.WebView.CoreWebView2.DocumentTitle;
     if (this.TBoxUrl.Text.Trim() == String.Empty)
     {
         this.TBoxUrl.Text = this.WebView.Source.ToString();
     }
 }
Пример #4
0
 private void _vistaHtml_DOMContentLoaded(object sender, CoreWebView2DOMContentLoadedEventArgs e)
 {
     if (this._tiempos != null)
     {
         this._tiempos.Add(new EntryOfTime
         {
             Etiqueta = "DOM CARGADO",
             Mensaje  = "Se ha terminado el dom de la página",
             Tiempo   = DateTime.Now
         });
         this.DibujaDiagrama();
     }
 }
Пример #5
0
 private void CoreWebView2_DOMContentLoaded(object sender, CoreWebView2DOMContentLoadedEventArgs e)
 {
     if (screenWebView.Source.ToString().StartsWith("https://www.youtube.com"))
     {
         screenWebView.Dock   = DockStyle.None;
         screenWebView.Width  = 15360;
         screenWebView.Height = 8640;
         // 破解分辨率(先伪装8K屏幕,然后还原)
         screenWebView.ExecuteScriptAsync("{ let YTInitCheckerId = setInterval(() => { if(yt?.config_?.WEB_PLAYER_CONTEXT_CONFIGS?.WEB_PLAYER_CONTEXT_CONFIG_ID_LIVING_ROOM_WATCH?.videoContainerOverride || ytcfg?.data_?.WEB_PLAYER_CONTEXT_CONFIGS?.WEB_PLAYER_CONTEXT_CONFIG_ID_LIVING_ROOM_WATCH?.videoContainerOverride) { clearInterval(YTInitCheckerId); NativeBridge.ActiveScreen(); } }, 1000); }");
         // 后台播放
         screenWebView.ExecuteScriptAsync("for (event_name of ['visibilitychange', 'webkitvisibilitychange', 'blur']) { window.addEventListener(event_name, function(event) { event.stopImmediatePropagation(); }, true); }");
         // 注入动画
         screenWebView.ExecuteScriptAsync("document.body.style.opacity = 0; document.body.style.transition = 'opacity 333ms';");
         // 隐藏片尾视频内链接
         if (!allowEndscreen)
         {
             screenWebView.ExecuteScriptAsync("{ const style = document.createElement('style'); style.innerHTML = 'ytlr-endscreen-renderer { display: none !important; }'; document.head.appendChild(style); }");
         }
     }
     else
     {
         screenWebView.Dock = DockStyle.Fill;
     }
 }
Пример #6
0
 private void WebControl_DOMContentLoded(object sender, CoreWebView2DOMContentLoadedEventArgs e)
 {
     initPanAndVolume();
 }
Пример #7
0
 private void CoreWebView_DOMContentLoaded(object?sender, CoreWebView2DOMContentLoadedEventArgs e)
 {
     IsLoading = false;
 }
Пример #8
0
 private async void webView_DOMContentLoaded(object sender, CoreWebView2DOMContentLoadedEventArgs e)
 {
     await LoadHtmlAsync((sender as Microsoft.Web.WebView2.WinForms.WebView2));
 }