Google launched a new fast browser recently (currently in beta) – Chrome. Getting in short, with ASP.NET we do have some functionality for detecting browsers using the Sys.Browser class.
Extend the prototype as follows,
//Google chrome check Sys.Browser.Chrome = {}; if (navigator.userAgent.indexOf(' Chrome/') > -1) { Sys.Browser.agent = Sys.Browser.Chrome; Sys.Browser.version = parseFloat(navigator.userAgent.match(/ Chrome\/(\d+\.\d+)/)[1]); Sys.Browser.name = 'Chrome'; Sys.Browser.hasDebuggerStatement = true; }
Once you have this included in your script file and loaded inside the page, you can check it out as follows,
if(Sys.Browser.agent == Sys.Browser.Chrome){
//Write code for Chrome specific browser
}
Hope this helps!!
-Fahad
Balaji said
Thats a great job…….
coffee said
it will be interesting to see if Chrome can get as much market share as Firefox; for now they seem to have leveled off…