|
|
|
| Hurry! Enter The Daily WTF's OMGWTF2 Contest by June 28th! - Prizes! Fame! Trophies! Do your worst: http://omg2.thedailywtf.com/ |
| « Check the Check Printer | Not the Sharpest Blade in the Data Center » |
You know what really gets to me? People who open links too quickly. Haphazardly opening new tabs all over the place...it really grinds my gears.
Ok, I've never thought that, but apparently somebody did when they added the code that Jonathan Peppers found in an abstraction layer for System.Windows.Forms.WebBrowser.
protected virtual bool OnNavigating(Uri url, byte[] postData)
{
NavigatingEventArgs nea = new NavigatingEventArgs(url, postData);
if (((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) &&
((Keyboard.Modifiers & ModifierKeys.Alt) != ModifierKeys.Alt) && IsInitiallyLoaded)
{
nea.Cancel = true;
HideWaitIndicator();
// Please don't submit this to the daily WTF
if ((DateTime.Now - _lastNewTab).TotalSeconds > 1)
{
_lastNewTab = DateTime.Now;
OnOpenNewTab(new NavigatingEventArgs(url, postData));
}
}
else
{
if (Navigating != null)
{
Navigating(this, nea);
}
}
return nea.Cancel;
}
|
If you ever find yourself writing a comment in your code that says "Please don't submit this to the daily WTF", it means two things:
1) you're doing it wrong. 2) it's going to end up on dailyWTF. |
| « Check the Check Printer | Not the Sharpest Blade in the Data Center » |