A Great Looking Site With Google Chrome

March 30th, 2009 | RSS Feed



If you're new here, you may want to subscribe to our Full RSS feed to get a daily digest of news around search engine industry.

After the launch of Google Chrome in September last year, many webmasters and web developers have raised questions on how to make their sites look good in Google Chrome. As a response to these questions, Glenn Wilson, Product Manager, Google Chrome is giving few tips in his post that will provide a stellar look to your website.

Detecting Google Chrome

As Safari and Google Chrome are web-kit based browsers, most of the sites will look same on both. If you think your site looks right in Safari, then it will definitely appear right in Google Chrome too.

Because of Google Chrome being new, many sites confuse it with another browser. If you find your site not looking quite good in Chrome in comparison to Safari, there is a possibility that your site is not recognizing Chrome's user-agent string.

Most of the platforms and browsers adopt WebKit as rendering engine, there are chances that your site automatically detects and supports them with right JavaScript checks. In maximum cases, sites use JavaScript to 'sniff' the navigator.userAgent property for both the browsers, Safari and Chrome. But, it is always better to use proper object detention. Even Gmail is detecting Webkit properly in Chrome from the very first day.

Google Chrome

For detecting the user-agent type, use this JavaScript to detect the WebKit:

var isWebkit =

navigator.userAgent.indexOf("AppleWebKit") > -1;

If you want to make sure that the version of WebKit is a certain version, or if you want to use a new WebKit feature:

var webkitVersion =

parseFloat(navigator.userAgent.split("AppleWebKit/")[1]) ||

undefined;

if (webkitVersion && webkitVersion > 500 ) {

// use spiffy WebKit feature here

}

Here are some of the browser releases and versions of WebKit used by them:

Browser Version of WebKit
Chrome 1.0 525.19
Chrome 2.0 beta 530.1
Safari 3.1 525.19
Safari 3.2 525.26.2
Safari 4.0 beta 528.16

Do not add 'Google' or 'Apple' to navigator.vendor checks for detecting the WebKit or Google Chrome, as this will be unable to detect other WebKit or Chromium-based browsers.

Other Tips:

  • Google Chrome supports NPAPI plugins but, do not support Active X plug-ins. This will enable you to show plugins in Flash and Java in Google Chrome, just like it is done on Safari and Firefox.
  • If you are finding the text on the site a bit off, check if proper content type and character encoding information is provided in HTTP response headers or at the starting of the page. A placement near the top of the section is more preferred.
  • It is wrong to block elements inside the inline elements.
    • Wrong: <a><div>This will look wrong.</div></a>
    • Right: <div><a>This will look right!</a></div>
  • If JavaScript is not working in Google Chrome, debug using Chrome's in-built JavaScript debugger, under 'page' menu-> 'Developer' -> 'Debug JavaScript' menu option.

If you want to know more about detecting WebKit, visit at http://trac.webkit.org/wiki/DetectingWebKit.

Click here to subscribe to our RSS feed to get a daily digest of news around search engine industry. PageTraffic SEO Blog is updated four times a day and is ranked as one of the best search engine resources blog by Pandia!


 


Comments

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

3 Responses to “A Great Looking Site With Google Chrome”

  1. Nicholas Simon Says:

    If you are new to Google Chrome check out my post here, could be useful.
    http://www.betterfasterpc.com/blog/google-chrome-the-good-stuff-extras.html

  2. tech news Says:

    yea , i m agree with this information that !!
    all website looks cool

    and Google chrome is useful for business people

  3. Артем Андреевич Says:

    Best browser now cause it's very simple, only userful things in interface.

Leave a Reply

Back to Top

Connect with us

Connect us on twitter
Connect us on facebook
Connect us on flickr
Connect us on youtube

Life@PageTraffic on Flickr

Anyone interested in bhajan?Yeh baby yeh!Enjoying drinks


More >>

Subscribe To Our SEO Blog


Enter your email address:

Delivered by FeedBurner

Search


PageTraffic on Facebook
SEO Blogs - Blog Catalog Blog Directory
Feedback Form