Tag Archives: webbrowser

Browser compatibility: Look at your market!

8Today I want to talk about a topic a bit touchy, the web browser backward compatibility. And in particular a strange behaviour: “The worldwide market share analysis followers”.

This is for me the biggest mistake in the web development when trying to figure out what to do and setup a backward compatibility plan. For the purpose of this article, I’ll take a case I personally had to face today. I’ve quickly developed with Bootstrap.js and JQuery a beautiful and reactive CV web site. It took me about 5 hours max, deployment to the Microsoft Azure cloud included. But before going live I would like to test it against different browsers to be sure about the displays. It’s okay for the Chromes, Firefox’s too, on my android tablet with integrated browser and chrome browser too, on my android samsung mobile too and then, the horror ! It totally sucks with IE 8 and lower… well… Let’s take a look at the famous “worldwide browser market shares” to figure out the impact of that. I use one of the reference analytics website, allowing me to export datas as csv and play a bit with Excel. The complete spreadsheet book is available for download at the end of this article. Here’s the world wide top 20 browsers in terms of market shares:


Okay but who’s compatible? I’ve aggregated these market shares based on the compatibility and assuming that the ‘other’ part wasn’t compatible to face the worst case:


Damn, 20%… I’ll need to take that in account… that’s pretty huge… So I’ll need to dev… STOP ! Who am I really targeting with my CV website? Well, future client and recruiters, mainly in Belgium… So let’s refine the results and take a look at the Belgian situation instead, perhaps it’s better:

BEShares BECompatible

Only 10% remaining… And now let’s refine again the analysis by testing the “others” in terms of compatibility :


Only 6% of possible incompatibility in the worst case… Well… That’s acceptable for me. The site will work fine in terms of content, just some features will be a bit ugly and the user experience will perhaps suck a bit, but anyway, most of the viewers will have great experience on it.

So will I spent the same amount of development time to the backward compatibility feature? Well, perhaps in the future, but it’s really not a priority.  If my target was the entire world, then yes I should, but let’s be honest, I don’t really care about Chinese or Russian recruiters. So what’s the point of these graphs excepted playing with Excel ?With this I really want to demonstrate you two things:

First, when you have to be backward compatible, don’t do it because you have to and everyone say it’s great to be, but because you have to. This point lead me to the second, always define and keep in mind your audience and don’t work based on “global datas” or techies chatting. That’s true for web development but also desktop applications, trainings, writing, everything! It sound obvious, but once again let’s be honest, who had never spend too much time on features or improvements who appears to be useless or minor once in production?

To conclude, keep that in mind: Know your target and it’s always better to develop for the future than develop for the past !

Catch you next time and keep it bug free !

You can download the Excel doc here

WPF, Webbrowser & Content DataBinding

Aujourd’hui j’ai été confronté a un petit problème. Je voulais afficher les résultats d’une recherche avec une mise en forme un peut travailler à la manière des résultats retourné par les recherches dans l’ancien HelpViewer de la MSDN 2008. (Bien meilleur que celui actuel, malgré le retour en arrière fait sur le v1.1 qui reste énormément moins ergonomique à mon gout et beaucoup plus lent, fin’ bref…)

Pour cela j’avais l’idée de rajoute comme result viewer un webbrowser intégré dont le contenu serait bindé a un string contenant la page html avec les résultats mis en forme. Seul hic a cette solution, impossible actuellement de binder le contenu d’un webbrowser avec le moteur de binding wpf…

Voici donc une petite Attached Property qui vous permettra de passer outre ce petit problème.

public class WebBrowserHelper {
    public static readonly DependencyProperty BodyProperty =
                                               new PropertyMetadata(OnBodyChanged));

    public static string GetBody(DependencyObject dependencyObject)
        return (string)dependencyObject.GetValue(BodyProperty);

    public static void SetBody(DependencyObject dependencyObject, string body)
        dependencyObject.SetValue(BodyProperty, body);

    private static void OnBodyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        var webBrowser = (WebBrowser)d;

Il suffit de rajouter la classe et de rajouter une référence vers son mainspace dans les xmlns de votre contrôle. Ensuite on l’utilise comme ceci :

<WebBrowser src:WebBrowserHelper.Body="{Binding MyHtml}" />

A vous les joie du binding avec un control WebBrowser en Wpf ^^

Istace Emmanuel

Src : http://thomasfreudenberg.com/blog/archive/2010/08/01/binding-webbrowser-content-in-wpf.aspx