Web Browser Detection on your site with an IFrame
Wouldn't it be nice for your users to not even have to leave your website so that they can detect what web browser they're using? Well now you can!
You can embed the best Web Browser Detection Website on the internet directly on to your site, so that you don't need to drive your users away from your site to find out what they're using.
It would be perfect to put this on your Technical Support page or perhaps your "Contact" page.
Don't forget, if you want to integrate this more tightly with your website or system, check out our API. You'll get tons more control; but if you just need a basic version, pop an IFrame in your page!
This guide assumes a basic understanding of HTML and IFrames and that you have the ability to insert HTML into your website. If you need to brush up on IFrames, view this page on W3Schools.
You can embed this in your page by inserting the embed html:
This will appear on your site like this:
You'll notice the inline CSS to remove the IFrame border; presumably you'll want to keep this too.
Also note that the IFrame is a little taller than it needs to be in most cases. We do this for two reasons:
- It's not possible for your site to "ask" the IFrame how tall it needs to appear (due to cross site browser security restrictions), so it has to just guess
- While most browser names are quite short and will fit on one line, some browsers (or platforms) have quite long names which can cause the read out to drop on to a second line, thus pushing everything down outside the height of the IFrame.
So, we make the IFrame a little taller than it usually needs to be, just in case.
As you can see, the default setting is just the most basic output from the site.
Depending on what you want to display to your users, you have the option of adding more information to the display. Read on to find out more.
One of the great features of whatismybrowser.com is that we can check if web browsers are up to date (for the major browsers). We now provide this as an option for the IFrame as well.
Simply add the parameter to the url:
and if we can determine if your browser is up to date, we will show you a message.
This will cause their capabilities to display as well.
If you want to show your users their Public IP Address, you can add the parameter to the url:
The full URL would look like:
Simliar to adding the Browser Capabilities or IP Address to the read-out, you can also set your user's Screen Settings to appear in the IFrame. This is done with the parameter:
This causes their main screen resolution and bit depth to display in the iframe:
A "View more info" link
If you're giving your users the standard minimal output, you may want to also include a link to "View more information about your web browser", so that it is still possible to easily optionally find out more information if they're curious. You can do this by specifying:
Combining these settings for a fuller display
The Capabilities and Screen settings can be combined, simply by including them both in the IFrame's URL.
Note that as a part of the HTTP specification, the first one is preceeded by a question mark and the following parameter/s are preceeded by ampersands. For example:
Customising the appearance
You might be totally happy with the plain white and black; but if you want to change things like the colors and fonts, this is the section for you.
The objective behind this is to make the embedded IFrame match your site's appearance as much as we can to give your users the most uniform and pleasant experience as possible.
As with the other URL parameters, these can be combined with the above Capabilities/Screen settings by adding them to the embed URL.
You must specify color codes as a three or six digit hexadecimal color code. You can't use named colors (like "darkblue") or images.
You can specify the background color of the IFrame by using:
For example, this makes the background a greeny/blue.
The typical use-case scenario for this is when you have the IFrame on a page with a non-white background and you want it to blend in with your content.
Note that our site intentionally sets the color that you specify on the html and body elements of the IFrame itself, not the "holder" div inside the IFrame, so that the color goes right to the edge and blends in with your site background. It looks a bit weird here because our site has a white background; but on yours it will look fine.
You can specify the color of the text in the IFrame by using:
For example, this makes the text greeny/blue:
You can specify the color of IFrame's border by using:
For example, this makes the border gold:
You can change the font family by specifying:
This makes the text use fonts with Serifs (eg Times New Roman). Only use this if the rest of your site uses Serif fonts and you want the browser detection to match the appearance. If you don't specify this, Sans Serif fonts will be used (which is the default).
If you want the display a bit smaller (perhaps to fit in a sidebar), you can specify
This makes the text smaller.
Just for completeness sake, we added:
just in case you need the display much larger too.
Putting it all together
This demonstrates combining some of the above options.
SSL and insecure content warnings
If after you put this IFrame on your site you get browser warnings about loading insecure content on a secure page; this means that you are using a https url for your site but are loading the IFrame without using SSL. To fix this, you can simply change the start of the IFrame url from http:// to https:// This should fix this problem. Our servers will automatically redirect your users to the secure version of our page so this problem shouldn't really occur unless your user is blocking redirects.
It's necessary for us to set some rules about using this service. We're very happy for you to put this on your site; but you have to play nice with it.
You can only embed an IFrame of WhatIsMyBrowser.com on your site provided that:
- You agree that all the standard Terms and Conditions of using WhatIsMyBrowser.com apply to using the Iframe.
- You will not intentionally obscure the link back to WhatIsMyBrowser.com in the bottom of the IFrame, and thus:
- It remains clear to all your users that the web browser detection is being done by WhatIsMyBrowser.com and they can click back to our site if they want.
- You understand that this is a new feature of the site which is still in development. The way that it works, including its configuration options and output may change without notice as other websites start to use it and we modify and improve its behaviour.
This entire feature was added because of a user's request; we're always really open to suggestions and feature requests. If this feature lacks something you require, or you have a suggestion about it, use the contact form to get in touch.
Love this feature? Support the site!
We spend a lot of time each week adding new features (like the the IFrame!) to the website and so a really nice way of supporting our work is to sign up as a patron on my Patreon.com account.
We suggest following the twitter account: @whatismybrowser, where we will post updates and changes to the system so that you can stay up to date.
If you have any questions about these rules, any suggestions for the Iframe or the site in general, or any aspect of implementing the Iframe on your own website, please contact us via the Contact page and we'll do our best to respond.
Hopefully this Iframe feature gives your customers a more pleasant and streamlined experience.
Thanks for using our site!