[c#] [UWP]在C#UWP Webview中隐藏元素而用户看不到它“消失” [英] [c#][UWP] Hiding Elements in C# UWP Webview without the user seeing it “disappear”

查看:93
本文介绍了[c#] [UWP]在C#UWP Webview中隐藏元素而用户看不到它“消失”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


好奇的一个;我正在开发一个Webview作为C#UWP项目的一部分。该网页是远程的,不是我托管的,我使用  webView。 InvokeScriptAsync  到
注入我自己的JS代码,该代码隐藏了相关网站的导航菜单。

Curious one; I'm working on a webview as a part of a C# UWP project. The webpage is remote and not hosted by me and I use the webView.InvokeScriptAsync to inject my own JS code that hides the navigation menu of the website in question.


它工作正常;但是用户可以"看到"它变得越来越隐蔽。页面加载,用户可以在被注入的JS代码隐藏之前简单地看到导航菜单。

It works fine; but the user can "see" it is getting hidden. The page loads, user can briefly see the navigation menu just before it gets hidden by the injected JS code.


我已经把  InvokeScriptAsync  
  DOMContentLoaded   event。

I have put the InvokeScriptAsync in the DOMContentLoaded event.


任何人都有任何提示吗?有没有一种方法可以隐藏这个用户不是更聪明的?当你看到"隐藏过程"时,它看起来很不专业。正在发生。

Anyone have any tips here? Is there a way this can be hidden with the user being none the wiser? It looks pretty unprofessional when you can see the "hiding process" is taking place.

推荐答案

正在思考; InvokeScripAsync如何工作?由于我在DomContentLoaded上运行,它是否有效地将脚本添加到HTML文档的末尾?如果是这样,导航菜单加载,然后隐藏的原因?我想加载HTML页面而不用
显示导航菜单。没有加载然后隐藏。有什么想法?
Just thinking; how does InvokeScripAsync work? Since I am running on DomContentLoaded does it effectively add the script to the end of the HTML document? If so is this why the navigation menu loads, and then hides? I would like the HTML page to load without the navigation menu showing at all. Not loading and then hiding. Any ideas?


这篇关于[c#] [UWP]在C#UWP Webview中隐藏元素而用户看不到它“消失”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆