jeudi 28 juin 2007

Maxthon : La solution pour régler tout vos problèmes de compatibilité CSS entre IE6 et IE7./Maxthon : best way to fix IE6/IE7 CSS Compatibility.

max-logo2Tout développeur web connait cette étape fastidieuse qui consiste à rendre son site compatible avec les différents navigateurs du marché. La solution la plus simple pour faire ces tests consiste à installer dans la joie et la bonne humeur tout les navigateurs qui utilisent des moteurs de rendu différent. Bien sur, il existe d’autre solutions ici et , mais cette méthode et à mon gout la plus pratique.

Any Web developer knows this tiresome stage which consists in making its site compatible with the various navigators of the market. The simplest solution to make these tests consists in installing in the joy and good mood all the navigators who use different rendering engines. Off course, you can find various solutions here and there, but this method is to my opinion, still the most practical.

 

Alors vous allez me dire, que viens faire Maxthon dans ce mique-maque, puisqu’il n’est en faite qu’une surcouche d’Internet Explorer. Et bien justement c’est là qu’est tout son intérêt. Le fait que Maxthon ne soit qu’un skin, va nous permettre de pouvoir utiliser les moteurs de rendu d’IE6 et d’IE7 sans avoir à installer les deux navigateurs (Attention, il en faut quand même un au minimum !).

Then you will ask me, what Maxthon has to do with this, since it is only a skin over Internet Explorer. And well precisely it is there that is all its interest. The fact that Maxthon is only a skin, will allow us to be able to use the rendering engines of IE6 and IE7 without having to install both navigators (Be careful, one of them is needed at least!).

 

Comment ça marche !? / How does it Work !?

De façon fort simple, en fait : la pierre angulaire du moteur d’Internet Explorer est logée dans une dll nommée Mshtm.dll. Maxthon fait appel à cette dll pour afficher vos pages en s’accommodant fort bien du fait que vous ayez installé ou IE6, ou IE7 sur votre poste. L’astuce consiste donc à posséder les deux versions de la dll (IE6/IE7) et à les inter-changé à volonté pour pouvoir obtenir les rendu désirés.

In an extremely simple way, in fact: the heart of Internet Explorer’s engine is placed in a DLL named Mshtm.dll. Maxthon calls this DLL to render your pages while adapting extremely well to the fact that you installed IE6, or IE7 on your workstation. The trick consists in having the two versions of the DLL (IE6/IE7) on board and to swap them to be able to get what you want.

 

Toujours dans l’idée de connaitre les différences entre les deux versions d’Internet Explorer, la même technique peut être appliquée à la dll responsable de Javascript (jscript.dll). Comme je l’ai expliqué dans un précédant billet, la version d’IE7 est plus rapide, mais elle se comporte également de façon différente sur certain points. J’ai par exemple constaté que l’event bubbler pouvait passer de l’état de « normal » à « super remifiant limite inutilisable » suivant la façon dont vous l’implémentez sur l’une ou l’autre des version du moteur Javascript.

Keeping in mind to better know the differences between both versions of Internet Explorer, the same technique can be applied to the DLL responsible of Javascript (jscript.dll). As I explained in a previous note, IE7 version is faster, but it also behaves in a different way on certain points. I for example noticed that the event bubbler could pass from the state of “normal” to “super slow near unusable” according to the way you implement it on one or the other version of the Javascript engine.

 

De la théorie à la pratique. / From Theory to practice.

Evidement, je ne vais pas vous proposer de changer les dll à la main, cela deviendrait très vite une corvée qui finirait par vous faire penser que réinstaller les deux versions d’IE sur votre poste n’était pas une si mauvaise idée que ça…

Well, I will not propose to you to manually change the DLL, that would very quickly become boring, which would finish making you think that to reinstall the two versions of IE on your workstation was not a so bad idea…

 

J’ai donc écris un plugin pour Maxthon qui vous permet de changer les dll de façon automatique. Vous pouvez même choisir si vous ne souhaiter intervertir que mshtml.dll ou jscript.dll.

That’s why I have written a plugin for Maxthon which enables you to automatically change the DLL. You can even choose if you to wish to swap only mshtml.dll or jscript.dll.

 

Le plugin ce telecharge ici pour la version 2.x de Maxthon.

Et pour la version 1x.

Plugin for the version 2.x of Maxthon can be downloaded here.

And there for 1x version.

 

Sont utilisation est extrêmement simple, puisqu’une fois installé, vous n’avez qu’a spécifier les dll que vous voulez changer en cliquant sur le « E ».

Ie engine Switcher

Ensuite, un clique sur le gros bouton (qui affiche en permanences les moteurs actuellement au travail) lancera la bascule des dll.

IE switch engine panel

Le navigateur ce ferme est redémarre tout seul.

Un coup d’œil sur le gros bouton vous affiche les nouveaux moteurs en cour.

Using it extremely easy, once installed, you just have to specify the dll that you want to change by clicking on the “E” icon. Then, one clicks on the large button (which show the engines currently at work) will launch the swapping of the DLL. The navigator will close and restart again by is own. A quick check on the large button will show you the new engines currently running.

 

Conseil d’utilisation. / Best practice. 

Mshtml.dll et jscript.dll ont un petit souci : tout le monde les utilise. Il pourra donc arriver que lorsque vous désiriez inter-changé une dll, celle-ci sois déjà en cour d’utilisation par une autre application, ce qui rendra l’opération impossible. Il est donc recommandé de faire ces changements de dll lors du début d’une séance de travail, ou juste après le démarrage de votre poste. Bien évidement vous pourrez toujours ré-intervertir les dlls au cour de la séance, mais la réussite de l’opération restera intimement lié aux programmes qui tournent en même temps que Maxthon.

Mshtml.dll and jscript.dll have a small drawback: everyone like to use them. It will be happen that when you wish to switch a DLL, this one would be already in use by another application, which will make the operation impossible. So, it is recommended to make these DLL changes at the beginning of a working session, or right after you’ve started your workstation. Of course, you will always be able to invert the dlls during the session, but the success of the operation will closely remain related to the programs which run at the same time as Maxthon.

 

Voici donc, une liste non éxostive des softs qui utilisent mshtml.dll et jscript.dll et qu’il sera impératif de fermer avant de procéder à la bascule des dll :

- Expression Web

- Pal talk

- Internet Explorer (qui l’u cru !!)

- Windows live writer

- Svchost (qui par moment ce réserve jscript.dll, ce qui est plus problématique...)

 

Here is, a preview list of software that use mshtml.dll and jscript.dll. Understand that it will be imperative to close those apps before proceeding to the DLL switching:

- Expression Web

- Stake talk

- Internet Explorer (can you believed it!!)

- Windows live writer

- Svchost (which sometime reserve jscript.dll, which is more problematic…)

 

Vous ne devriez donc avoir aucuns problèmes si vous avez ouvert en même temps : Firefox/Safari/Opera ou Dreamweaver (qui utilise le moteur d’Opera)

Voila, bonne amusement avec ce plugin, n’hésitez pas à me contacter pour signaler bugs ou améliorations.

You should not encounter any problems if you opened at the same time: Firefox/Safari/Opera or Dreamweaver (which use Opera’s engine)

That’s all, have a nice time playing with this plugin, and do not hesitate to contact me for bugs report or any improvements.

 

Aucun commentaire:

Enregistrer un commentaire