Fix SharePoint 2010 for Opera Part I

March 28 2011 6 comments

I can’t use IE9 because UAG doesn’t support it yet on VPN connections. I can’t use IE8 or older because they don’t play well with the rest of the Web. I can use Google Chrome, Apple Safari, Mozilla Firefox and of course Opera. SharePoint 2010 plays fine with all these new generation browsers, except for the one: Opera. Opera isn’t supported, and I’m glad to disagree.

Scrollbars are handy but sometimes we don't need them

First things first. The top portion of the Ribbon has a nasty scrollbar slobbering all over it. We’ll get rid of that with a simple CSS rule:

#s4-ribbonrow { overflow: hidden; }

Now onto the hard part. Click the Site Action button on the top left corner of the viewport. Nothing happens? I’m going the skip right through the details. The OnClick event of the Site Actions button calls the MMU_Open() -function which itself calls the MenuHtc_show() -function in order to display the pop-up menu. Both of these functions are located in the Core.js.

A look on the MenuHtc_show() -function tells us the the execution of the function stops, if the browser object doesn’t hold a fresh enough version.

if (!(browseris.ie55up || browseris.nav6up || browseris.safari125up))
    return false;

Apparently the latest Opera build isn’t good enough for SharePoint (in my opionion it’s the other way around). The browseris-object is built in the init.js and there we can see no references to the Presto layout engine Opera uses. I will add a simple and dirty support for opera and I’m not going to modify these two files since that is not in line with best practices. Obviously this is something Microsoft usually fixes in the future with cumulative updates, and they might change something that we are not aware of, making the page scream with Opera again.

I’ve got my external JS file somewhere in the hive, and I’ll just add ‘support’ for Opera. The trick is to camouflage Opera as a Mozilla browser. To do this, I’ll use my favourite JS lib jQuery for dead simple browser detection and pass true the nav6up property of the browseris object if the browser is Opera with a recent major version.

browseris.nav6up = ($.browser.opera && $.browser.version >= 10) ? true : browseris.nav6up;

There you go. The Site Actions menu works and the Fat Lady can sing. Unfortunately there is more. Once you hover over the menu items, the ribbon content goes up. The webpart properties menu is also dead. But this should be enough to get you started with Opera. On the next part, I’ll concentrate on those issues.

Popularity: 1% [?]

6 comments to “Fix SharePoint 2010 for Opera Part I”

  1. Aviw says:

    You may just set “Browser Identification” to “Mask as Firefox” in “Site Preferences” menu.

  2. I have to tell you that it’s hard to find your posts in google, i found this one on 17 spot, you should build some quality backlinks in order to
    rank your site, i know how to help you, just search in google – k2 seo tips

  3. You play a special force combatant, the sole survivor who has to survive and kill all zombies and escape the
    streets. The controls in Hostel: The Killing Floor is similar to a standard FPS: press the arrow or WASD keys
    to move around and attack or open doors by clicking the left
    mouse button. The guidelines to play these friv games are provided in this website.

  4. You must visit great web platform sie sucht sie für sex for lonley guys to chat with hot sexy ladies for free!

  5. shemal lille says:

    shemal lille is great web portal for you if you are alone in France

  6. Angel17 says:

    I will definitely visit this site again. All of this blog provides a very informative post.

Leave a Reply