Making your site compatible with all major web browsers is very important to reach people all over the world, as you can’t insist that people use a specific browser for viewing your site. Google Chrome is also becoming popular among the netizens, so it is better to make your site compatible with Google Chrome, apart from all the others.

The article will help you make your site compatible with Google chrome.

Detecting Google Chrome

Google Chrome is a web-kit based browser. Hence, if your site is compatible with web-kit based browsers like Safari, then your site will look good in Google Chrome as well. If it is not, then your site may not recognize Chrome’s user-string.

Google has given the following solution for this issue:
As platforms and browsers adopt WebKit as their rendering engine, your site can detect and support them automatically with the right JavaScript checks. Commonly, sites use JavaScript to ‘sniff’ the navigator.userAgent property for “Chrome” or “Safari”, but you should use proper object detection if possible. In fact, Gmail has been detecting WebKit properly in Chrome since day one!

If you must detect the user-agent type, you can use this simple JavaScript to detect WebKit:

var isWebkit = navigator.userAgent.indexOf(“AppleWebKit”) > -1;

Or, if you want to check that the version of WebKit is at least a certain version—say, if you want to use a spiffy new WebKit feature:
var webkitVersion = parseFloat(navigator.userAgent.split(“AppleWebKit/”)[1]) ||
undefined;
if (webkitVersion && webkitVersion > 500 ) {
// use spiffy WebKit feature here
}
For reference, here are a few browser releases and the version of WebKit they shipped:

We do not recommend adding “Google” or “Apple” to your navigator.vendor checks to detect WebKit or Google Chrome, because this will not detect other WebKit or Chromium-based browsers!

Display Content
Google Chrome can render content correctly, only when content and character encoding declaration information are provided at the top of your document’s source. Also it doesn’t read encoding information that’s declared with document.write (). If your site has frames or i-frames, then specify the encoding information at the top of the source of those frames.

Popup
Google Chrome will display only the title bar of pop-ups in the lower-right section of the browser window, in order to prevent undesired pop-ups from covering the page. If needed, users can view a pop-up’s content by dragging its title bar into a more visible position.

Scripts
Google Chrome supports only Netscape Plug-in Application Programming Interface (NPAPI) instead of ActiveX. Hence, if you want to load ActiveX control, specify the NPAPI version of the plug-in.