title: How can I reliably detect a link click in UIWebView?
body: <p>I have a <code>UIWebView</code> and I need to do something when user taps a link. There’s a delegate callback that can be used to detect the taps:</p>
  
  <pre><code>- (BOOL) webView: (UIWebView*) webView
      shouldStartLoadWithRequest: (NSURLRequest*) request
      navigationType: (UIWebViewNavigationType) navigationType
  {
      if (navigationType == UIWebViewNavigationTypeLinkClicked) {
          …
      }
  }
  </code></pre>
  
  <p>The problem is that this code doesn’t handle all link clicks. As an example, a plain Google Search results page does something weird with the links:</p>
  
  <pre><code>&lt;a href="http://example.com/" class="l" onmousedown="return rwt(…)"&gt;
      &lt;em&gt;Link Text&lt;/em&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>The <code>rwt</code> function results in the links not triggering the <code>UIWebViewNavigationTypeLinkClicked</code> event when tapped. Is there a way to reliably detect all events that fall into the “navigate to some other page” bucket?</p>