• Welcome to Simple Machines Community Forum. Please login or sign up.
October 26, 2021, 01:25:07 AM

News:

Want to get involved in developing SMF, then why not lend a hand on our github!


browser detection Chrome no longer webkit

Started by nend, November 29, 2015, 06:07:08 PM

Previous topic - Next topic

nend

Chrome is no longer a web kit browser since Chrome 28.0.1500. - Reference

It is still being set as a web kit brower in Load.php.

Also this line
      'is_webkit' => strpos($_SERVER['HTTP_USER_AGENT'], 'AppleWebKit') !== false,

I believe is a bad idea, just because if a browser has AppleWebKit in the user agent string doesn't mean that it is a web kit browser.

The current version of Chrome is VER 46.0.2490, I believe it is safe to say that most versions in the wild no longer have the webkit engine.

So change the line above to.
      'is_webkit' => strpos($_SERVER['HTTP_USER_AGENT'], 'AppleWebKit') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') === false,

And this
   $context['browser']['is_chrome'] = $context['browser']['is_webkit'] && strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== false;
To
   $context['browser']['is_chrome'] = strpos($_SERVER['HTTP_USER_AGENT'], 'AppleWebKit') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== false;

This will fix the positioning issues in Chrome with the WYSIWYG editor.

Advertisement: