效果:开始的时候会显示几秒,之后就不会再显示了
<!--浏览器-->
<cefSharpWPF:ChromiumWebBrowser Name="webBrowser" Grid.Row="0" >
</cefSharpWPF:ChromiumWebBrowser>
public MainWindow()
{
InitializeComponent();
webBrowser.FrameLoadEnd += OnBrowserFrameLoadEnd;
}
private void OnBrowserFrameLoadEnd(object sender, FrameLoadEndEventArgs args)
{
if (args.Frame.IsMain)
{
args
.Browser
.MainFrame
.ExecuteJavaScriptAsync(
"document.body.style.overflow = 'hidden'");
}
}