My private Web site is now IE 9 enabled!

I just finished “upgrading” my private website with IE 9 features.

One of the nice new features of IE 9 is the fact that you can now drag&drop an IE tab to the Windows 7 taskbar and pin it there for easy bookmarking.

Windows 7 on the other hand allows pinned applications to extend the context menue of the pinned icon with additional entries to give easy access to often used functions. IE 9 now has an extended object model which can be accessed from Javascript which allows to use this Windows 7 funktionality directly in IE 9.

My private website now also supports this functionality. The context menu is now extended with links to the the most important subsites of my site and it also includes a link to the email subscription page:

Here are the details on how to enable the functionality:

To get something added to the “Tasks” section you don’t even have to write javascript code. A simple meta tag is sufficient:

<meta name=”msapplication-task”
     content=”name=E-Mail Benachrichtigungen abonnieren ;
     action-uri=http://www.stefan-gossner.de/index.php/email-benachrichtigung;
     icon-uri=http://www.stefan-gossner.de/wp-content/themes/Alaska-1/images/Alaska.ico” />

Adding the new section “Stefan’s Favorites” is a little more tricky and requires Javascript code. To ensure that it does not cause problems on other browsers which do not support this new functionality I have included the code in a try/catch block:

<!— Start IE9 Taskbar –>
<script type=’text/javascript’>
try {
window.external.msSiteModeCreateJumplist(‘Stefan\’s Favorites’);
window.external.msSiteModeAddJumpListItem
 (‘Kochrezepte’ ,
  ‘http://www.stefan-gossner.de/index.php/kochrezepte’,
  ‘http://www.stefan-gossner.de/wp-content/themes/Alaska-1/images/Alaska.ico’);
window.external.msSiteModeAddJumpListItem
 (‘Divelog’ ,
  ‘http://www.stefan-gossner.de/index.php/divelog’,
  ‘http://www.stefan-gossner.de/wp-content/themes/Alaska-1/images/Alaska.ico’);
window.external.msSiteModeAddJumpListItem
 (‘Witze’ ,
  ‘http://www.stefan-gossner.de/index.php/witze’,
  ‘http://www.stefan-gossner.de/wp-content/themes/Alaska-1/images/Alaska.ico’);
window.external.msSiteModeAddJumpListItem
 (‘Fotogalerien’ ,
  ‘http://fotos.stefan-gossner.de’,
  ‘http://www.stefan-gossner.de/wp-content/themes/Alaska-1/images/Alaska.ico’);
window.external.msSiteModeAddJumpListItem
 (‘Blog’ ,
  ‘http://www.stefan-gossner.de’,
  ‘http://www.stefan-gossner.de/wp-content/themes/Alaska-1/images/Alaska.ico’);
} catch (ex) {
}
</script>
<!— End IE9 Taskbar –>

That’s all!

As you can see it is very simple to extend an existing website to use this new IE 9 feature.

6 Comments


  1. so it seems you are one of those developers who doesnt know history and is about to repeat it. cool. another wave of sucky IE-only sites with stupid "extended" stuff that's not standard and wont work anywhere else. congrats.

    Reply

  2. Hi "me".

    Usually I do not comment on such insulting comments like this – especially if the person insulting me is not man enough to identify himself with at least an email address.

    But as it seems that you did not even try to understand the difference between previous mistakes and the current enhancements I will try to help you with this: the code above does not change anything in the rendering of the site. The site will still look the same in all browsers. It is the OS intergration which I used.

    That is similar to providing an RSS feed on my site. Should I – just because some people don't have an RSS reader or don't want to use it – not provide an RSS feed on my site?

    I doubt that you will find many people who would agree with you if you would say "yes" here.

    .

    Beside that: most functionality in modern browsers have been introduced by one or the other browser first before it became standard. If noone would use the new functionality then the functionality would not make it into a new standard.

    Reply

  3. I like the feature and I wish other browser vendors will pick it up soon…

    However, does it require a later build than the public version of IE 9? I tried your code but get an "undefined" error when "window.external.msSiteModeCreateJumplist" is called 🙁

    System is Windows 7 Ultimate US-English x64 with IE 9 public beta.

    Reply

  4. Hi Sig,

    I used the public beta of IE9.

    Did you test it while the page was pinned to the taskbar?

    Because only then the code will be executed successfully.

    The try/catch block is important to avoid issues if the pinning has not happend.

    You can see the working code here on my website:

    http://www.stefan-gossner.de

    Cheers,

    Stefan

    Reply

  5. Hi Stefan,

    Doh! Next time I'm going to RTFM thoroughly before posting dumb comments 😉 Of course I missed the point that it has to be pinned before it works…

    BTW, do you really surf with 384KB @ home? Where on earth do you live, it must be out in the sticks 😉

    Cheers,

    Sig

    Reply

  6. Yes. Only 384 KB. It is a very small village at the very end of a DSL line. They are planning to add some fiber cables in a couple of years but right now: only 384 KB.

    I thought about SkyDSL – but the problem with that is that the network latency is to high to allow me to dial in into our corporate network.

    But 384 KB is enough for a remote desktop session to my office machine.

    Reply

Leave a Reply to Stefan Goßner Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.