Click here to Skip to main content
15,887,946 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
i need my asp.net page to check the google chrome extension if user is using chrome as their browser.

Either:
- Check google chrome extension, if not found, show message.

or:
- auto link to google web store and auto install the extension.

im stuck at here
C#
System.Web.HttpBrowserCapabilities browser = Request.Browser;
           if (browser.Browser == "chrome" || browser.Browser == "Chrome")
           {
               this.Label1.Text = "You are using Google Chrome";
           }
Posted
Comments
Sergey Alexandrovich Kryukov 23-Sep-13 21:40pm    
Why on Earth?
—SA

1 solution

ASP.NET has nothing to do with Chrome extensions, by one simple reason: it's based on HTTP standards which has no notion of such extensions. Your request for browser capabilities is based on the standardized HTTP headers (but Chrome or any other browser's identity can easily mocked by any other browser; such trick is sometimes used to overcome limitation of some stupid Web sites).

I think you are trying to move in wrong direction. Decent Web application should run on all of major browser's and be focused not on "extensions", but just the opposite: on standards.

—SA
 
Share this answer
 
Comments
melvintcs 23-Sep-13 22:27pm    
thank you for the reply. i have a code which open new tab in IE and FF, but new windows in Chrome. i did some research, they said this is the settings of the chrome itself, there's nothing we can do about it. that's why i need to use extension to help me. i tried too many ways and i give up :(
http://www.codeproject.com/Questions/649311/new-tab-in-IE-and-FF-but-new-windows-in-Chrome
i cannot run "Proceed.Start" after i upload to server, i believe it's some security reasons
Sergey Alexandrovich Kryukov 24-Sep-13 0:28am    
Okay, certainly a wrong move. Tab vs. separate browser window is something which is not regulated by the Web standards. It's not so good to use any of them. The user knows better how to navigate from an anchor. And even if you use some extension, why would your Web application be aware of it (which is anyway impossible)? You can use light-weight windows on the same page...

By the way, I noticed that Mozilla creates either a separate window or a tab, depending on window.open parameters. This is all browser's peculiarities (based on some common sense, hopefully) which you cannot and should not rely on. Even if some extension modify such behavior, what are you going to do with it?

—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900