Wednesday 15 February 2012

javascript - Blocking custom ad dialog in webbrowser -


I have checked the other thread but I am not working for them, after that I have implemented so far Is:

  Private Zero Injection Alertblocker () {HTMLElement head = webBrowser4.Document.GetElementsByTagName ("head") [0]; HTMLElement Script AL = WebBoarder 4 Document Crate Element ("script"); IHTMLScriptElement element = (IHTMLScriptElement) scriptEl.DomElement; String alertbalker = "window.showModalDialog = function () {};"; AlertBlocker + = "window.alert = function () {};"; AlertBlocker + = "getUrlParam (strParamName) {};"; AlertBlocker + = "getSpecialUrlsParam (strParamName) {};"; AlertBlocker + = "closeButton ();"; Element.text = warning blocker; Head.AppendChild (scriptEl); }   

InjectAlertBlocker () is said to be navigated and completed event.

In addition, I have also tried:

  Private Zero webbrowser_newwindow (Object Sender, CancelEventErguesE) {Web browser wb = Sender as Webbrozer; If (wb! = Null) Adytax Diablob ("Anwsodo quoso abrar un popup:" + wb.Url); E.Cancel = true; }   

The site URL I want to cancel is like: Warning scam-like link

I have created a patch / fix solution in two steps ... bit hackney ...

To check the URL, and if it is redirected, then the next URL What we get for the Edible String on ()

Then on navigating (just to be sure) and before navigating, in such cases, I Trim like RL:

  Private string noAdBooth (string) Lnk) {if (lnk.Contains ("& amp; url =") & amp; amp; ; Amp; lnk.Contains ("adbooth")) (A adressex debug ("adbooth omitted"); // add txt debug lnk = lnk.Substring (lnk.IndexOf ("& amp; url =") + 5); } Return LNK; }    

No comments:

Post a Comment