title: Detect webkit browser in javascript?
body: <p><strong>EDITED:</strong> 
  I actually used PHP to detect and create a local variable with php tags.</p>
  
  <pre><code>if ( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'webkit')) {
      $is_webkit = "true";
  }
  </code></pre>
  
  <hr>
  
  <p>How do I detect if the browser is webkit based? (Google Chrome, newer Opera, safari);</p>
  
  <p>I've tried this:</p>
  
  <pre><code>var isWebkit = (window.webkitURL != null);
  if(isWebkit){
      alert("i am a webkit based browser!");
  }
  </code></pre>
  
  <p>Doesn't work for safari</p>