I would like to my script work after website refresh. I have JavaScript code that is injecting to webbrowser.
string element = "alert(\"hello\")";
form1.webBrowser1.Document.InvokeScript("eval", new object[] { element });
I would like to my script work after website refresh. I have JavaScript code that is injecting to webbrowser.
string element = "alert(\"hello\")";
form1.webBrowser1.Document.InvokeScript("eval", new object[] { element });
Shamelessly stolen from here:
"You don't want the refresh, you want the onbeforeunload event.
http://msdn.microsoft.com/en-us/library/ms536907(VS.85).aspx
Sample code from article"
<HTML>
<head>
<script>
function closeIt()
{
return "Any string value here forces a dialog box to \n" +
"appear before closing the window.";
}
window.onbeforeunload = closeIt;
</script>
</head>
<body>
<a href="http://www.microsoft.com">Click here to navigate to
www.microsoft.com</a>
</body>
</html>