Created
July 9, 2013 10:35
-
-
Save AlexArchive/5956398 to your computer and use it in GitHub Desktop.
Old School Runescape Client Without HTML Menu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal sealed class RunescapeClient : WebBrowser | |
{ | |
private const string RUNESCAPE_CLIENT_URL = "http://oldschool33.runescape.com/j1"; | |
internal RunescapeClient() | |
{ | |
ScrollBarsEnabled = false; | |
ScriptErrorsSuppressed = true; | |
IsWebBrowserContextMenuEnabled = false; | |
AllowWebBrowserDrop = false; | |
Navigate(RUNESCAPE_CLIENT_URL); | |
} | |
protected override void OnDocumentCompleted(WebBrowserDocumentCompletedEventArgs e) | |
{ | |
if (Document != null && ValidClientUrl(e.Url.ToString())) | |
{ | |
HtmlElement tableElement = Document.GetElementsByTagName("table")[1]; | |
tableElement.InnerText = string.Empty; | |
} | |
} | |
private static bool ValidClientUrl(string url) | |
{ | |
return Regex.IsMatch(url, @"http://oldschool\d{1,2}.runescape.com/j1"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment