i am trying to hide an element before the page load
i tried using webview extras to inject JS on page finished
it worked, but there is about half of a second the element is visable until JS is executed (the element flicker quickly)
how can i hide that element before the page load so it wont appear at all ?
yes but i have small to no control over the content
1- i don't want to hide these elements for browser visitors (need to hide them only in my app webview)
2- i am using an eCommerce platform with caching it is very hard to modify the current html or css or JS
the problem is the way how things get executed by a browser and your injected js will be the last thing that will happen.
you could hide it via (inline) css then it is immediatly gone but then you have problems with your none app connections.
if it was an own product your could just send over a parameter to tell the backend it's coming from an app and then add the class hiding style to your html code.
Admittedly, I'm not well-versed in the WebViewExtras control, but could you not make the control .Visible=False before you execute the LoadURL and WaitFor the _PageFinished event to make the control .Visible=True? Or does your added JavaScript not re-trigger the PageFinished again?
'pseudocode
WebView1.Visible=False
Webview1.LoadUrl("www.someplace.whatever")
Wait For PageFinished(arguments)
'inject my java
'another wait for here or not, I've not used the WebView extras control
Webview1.visible=True
@Jeffrey Cameron : ok, I get your point now. I thought you meant hiding the item and then load another page and hide it again after pageload.
but this is only valid for the first load then.
@sorex yes i know, since @Devv didn't tell us the url we can't try and see by the mean of "half of second... that make flicker quickly". I just wondering if using script above when execute on PageFinish is still flickering or not. ?
@sorex yes i know, since @Devv didn't tell us the url we can't try and see by the mean of "half of second... that make flicker quickly". I just wondering if using script above when execute on PageFinish is still flickering or not. ?