Skip navigation.

ODIN Blog

Opera Developer Network

Posts tagged with "browser sniffing"

Are you a browser sniffer? Get your site ready for a new smell

,

Opera released an alpha of Opera 10 earlier this month. One reason for alpha releases is to find and fix potential problems and bugs. These can either be browser bugs that we have to fix or site bugs where the site’s developers need to fix. Opera 10 has uncovered a flaw in many browser sniffer scripts, that causes the script to detect Opera 10 as Opera 1. This is because they only detect the first digit of the version number. My colleague Hallvord Steen has more information in his blog post 10 is the one. I'd recommend anyone that developers web sites to download the latest alpha and check their sites for this and other potential issues, before Opera 10 goes final.

This issue has caused problems on many big sites from Microsoft Live to Bank of America. If it isn't fixed the sites will also likely stay broken for when browsers like IE 10 get released in a number of years time. Unfortunately we are the ones leading the pack into this particular issue.

Public consultation on browser standards for public sector Web sites: Opera's response

, , ,

UPDATE

19 January 2009: This post contains a formal response to a superseded consultation document. The revised browser testing guidelines are now available. The remainder of this post is for historical purposes only.

Introduction

This is Opera Software's response to the Public consultation on browser standards for public sector Web sites by the United Kingdom's Central Office of Information (COI).

Opera Software ASA is a company headquartered in Norway. Noway is a signatory to the European Economic Area Agreement, which guarantees free trade with all EU states and cooperation in such matters as consumer protection, culture, education, and information services (see http://www.eu-norway.org/about/eeaforside.htm).

Many of our users are within the United Kingdom and the European Union, and we feel that the draft guidelines (“the guidelines”) potentially disadvantage them.

We support the aim of the COI to ensure inclusion by testing public authority Web sites on a range of browsers. It is also laudable that the COI requires that Web sites be made accessible to people with disabilities and across multiple operating systems.

However, we feel that there are some aspects of the browser guidelines that need re-drafting. We request that our concerns be considered and give permission for them to be quoted with attribution in any report on this consultation.

Executive summary

Opera believes that the current guidelines attempt to reinvent a wheel that has already been satisfactorily invented and refined over time by other large organizations, both public and private. Reusing their work reduces costs to taxpayers.

Also, Opera believes that the guidelines in their current form

Recommendations

The guidelines should recommend using Web standards and a best-practice development methodology called “progressive enhancement”. This will help ensure compatibility across browsers, rather than aiming at different browsers as if they are completely separate targets.

For testing, the guidelines should recommend adoption of browser support matrices such as the one provided at http://www.bbc.co.uk/guidelines/futuremedia/technical/browser_support.shtml/ by the BBC, which is a well-respected Web brand with a public-service duty and a huge, diverse audience.

This would support

  • greater competition in the browser market

  • greater value for money for taxpayers

  • more consistency for Web visitors and developers, and

  • savings on Web development costs by promoting Web standards and proven methodologies.

These benefits are also noted in the BBC's Objectives of Web browser support, which gives the methodology by which their browser-support matrix was devised at Appendix 2.

Guidelines restrict choice

Guidelines confuse popularity with capability

Paragraph 15 says “There may be specific browsers that you choose not to fully support because they are either old or unpopular.”

It is legitimate to choose not to support old browsers fully that are not capable of rendering sites made with Web standards and progressive enhancement.

However, it is wrong to decide not to support a browser purely because it is “unpopular”. If it is capable of rendering the site, it should be supported.

The guidelines' introduction states, "It is important to declare which browsers your website has been tested on. This demonstrates a clear commitment to your audience. Users will want to know whether or not your website works with their browser."

We disagree. By naming the browsers on which a Web site has been tested (simply because they are more “popular”), the impression is given that browsers that were not mentioned are somehow “second class”, and its users are not worthy of attention, which demonstrates a clear lack of commitment to audience needs.

We recommend adopting a testing statement such as that used by the Solicitors Regulation Authority:

Browser compatibility

It doesn't matter how old your browser is—you can use this website. It looks different in some older browsers, and is mostly text in very old browsers (like Netscape 4, or Internet Explorer for Macintosh). But the information is the same, and so are the things you can do.

Guidelines inconvenience users

This erroneous impression of less “popular” browsers as being inferior is reinforced in the sample “browser support statement” in paragraph 12.

Webmasters are advised to list browsers they have tested in as “supported”. The example browser support policy statement includes the message "We advise you to upgrade your browser version as far as your computer allows and if possible to one of those listed above".

There are also many reasons why a user may not be able to change their browser easily – for example, they

  • may not be using their own computer and be on a shared computer; therefore, they are unable to change or update the browser,

  • may use a particular browser because of security or privacy settings,

  • may use a particular browser due to features that help them access and are unable to use another browser comfortably,

  • may not know how to change their browser.

Many users of the most “popular browser” made no conscious choice to use that browser. On the other hand, we know that many Opera users choose Opera because of features such as excellent keyboard support, the built-in voice browser, intelligent zoom, and fit-to-width display, which are very useful for people with disabilities. It is unreasonable and unfair to suggest that they upgrade because a Webmaster has elected not to test in Opera.

Potentially anti-competitive

Not only does this inconvenience the user, but we strongly believe that this is anti-competitive.

The guideines help perpetuate current market shares by encouraging users of “unsupported” (in reality, “untested”) browsers to replace their current browser with another.

(Disclosure: The EU Commission are opening an investigation into an anti-trust complaint filed by Opera on 12 December 2007, regarding Microsoft bundling Internet Explorer in the Operating System and not implementing Web standards.)

Guidelines do not promote best practices

The guidelines are published because it is “impractical and inefficient” to test in all browsers. Presumably this should be interpreted as the COI suggesting that it is not cost-effective to do so. However, it is unnecessary to do so if best-practice Web development is followed.

Best practices should be central to guidelines

The section “out of scope” notes, “How to code for browser compatibility [and] Development methodologies such as graceful degradation and progressive enhancement,” are out of scope.

Additionally, paragraph 40 notes “These guidelines do not advocate specific development methodologies, for example, graceful degradation or progressive enhancement. However, it is widely accepted that sites conforming to open Web standards such as XHTML and CSS are more likely to work well across a wide range of browsers. The importance of working to technical standards is highlighted in Minimum technical standards”.

Opera believes that the guidelines must recommend the development methodology known as “progressive enhancement” which, when based on Web standards, would reduce inconsistencies between browsers resulting in greater interoperability.

When this methodology is employed, users of the most capable browsers automatically receive the highest quality user experience, while users of less capable browsers will receive content and be able to access basic functionality. Therefore, no-one will be “locked out", whereas being "locked out" is much more likely if you choose consciously to test only in/support specific browsers.

Guidelines erroneously treat Web as a visual medium

The guidelines treat the Web as if it were a visual medium such as print, in which designers specify pixel-perfect layout and can rely on that being delivered to the consumer.

This is not true and is inappropriate for public-service websites, where the emphasis is on content rather than aesthetics.

Paragraph 41 says, “A browser is semi-supported if the content and navigation works but the website does not display as intended”.

It is incorrect to judge a Web site on whether it displays “as intended”. A Webmaster cannot mark a browser “down” as semi-supported because it does not have curved borders, opacity, or the same fonts as those on a designer's machine.

By emphasizing “intention”, the guidelines legitimize preservation of design as a goal. In the past, this has led many bad design decisions such as fonts being expressed in pixel sizes which cannot be resized in Internet Explorer, for example.

The Web site should be judged on whether the recipient can use it in a format that (s)he wishes. If, for example, a browser mis-renders a site built with Web standards, such that content is obscured or is illegible, then that browser is unsupported.

If a browser renders the content as legible, the navigation usable and functionality operable, then that browser is fully supported in the context of a public-service site.

Best practices lead to cost-savings

Recommending best practices whereby developers code to internationally-agreed standards rather than to circumvent the quirks of today's market leaders leads to cost savings throughout the life-cycle of a Web site:

  • It is more cost-effective to build right than to correct during testing, so explicitly advocating progressive enhancement results in more efficient development and Web sites being quicker to market.

  • Reducing inconsistencies through smarter development ensures that the “testing” phase is shorter and, in the case of static pages of content, it should be possible to reduce testing to a quicker “verification” stage that quickly checks across a range of browsers that there are no significant inconsistencies.

  • Once deployed, Web sites built using valid, semantic (X)HTML and CSS are more maintainable because they are in accordance with international standards.

Guidelines are too fragmented

The guidelines mention design methodology and minimum technical standards in paragraph 40, but it is a leap of faith to assume that everyone else will read the second document.

The guidelines are written “for all website managers, web developers and web testers delivering public sector websites”, so we recommend that all the guidance relevant to these groups be amalgamated —or developers will naturally assume this supersedes all other guidance and start developing to browsers.

Additionally, the “Minimum Technical Standards” document is dated May 2002 and is obsolete; it mentions CSS 2 as the latest version, allows HTML tables for layout, and does not mention Scalable Vector Graphics (SVG).

Opera recommends modernizing this document and incorporating the updated guidelines into a comprehensive document aimed at the target audiences named on the cover.

Guidelines do not address mobile and other devices

Paragraph 39 notes that Guidance on support for mobile platforms will be the subject of future guidance. Other devices are described are similarly “out of scope”. (Paragraph 37 also notes, “Guidance on support for mobile platforms will be the subject of future guidance”; we assume this is an editorial error.)

This further fragments the guidelines, as readers will have another set of guidelines to check.

Different guidelines are unnecessary. Recommending a progressive enhancement methodology ensures that Web pages work across all browsers and devices.

Guidelines ignore plug-ins which are independent of browsers

The guidelines ignore the subject of browser plug-ins, such as those that allow readers to access PDF, MP3, video, and Flash content. These plug into a browser but are independent of it. Therefore, a group of users running the same version of a browser may have different versions of plug-ins and receive markedly different experiences.

For example, a visitor running Opera 9.5 with Flash Player 6 would not be able to take advantage of any accessibility features built into a Flash movie, while a visitor running Opera 8 with Flash Player 7 would be able to use those accessibility features, because the plug-in has a higher specification, even though the browser is less capable.

The guidelines should address plug-ins, independently from browsers.

Opera also suggests that the guidelines for Web developers require the use of open standards wherever possible, while allowing content that requires plug-ins as a secondary delivery method.

Guidelines should recommend testing by disabled users

Opera welcomes the guidelines' inclusion of a requirement that Web sites be tested with assistive technologies.

However, the guidelines currently legitimize a sighted developer using a trial version of a screenreader and comparing the synthesized speech with the words on a screen, which is inadequate testing; a sighted user cannot have the same experience or knowledge of the tool as a real user.

Therefore, we believe that it should incorporate guidance from the British Standards Institution's Publicly Available Specification (PAS) 78, Guide to good practice in commissioning accessible websites:

  • “All organizations, regardless of size, should ensure that those testing the website are different from those developing it.”

  • “Website commissioners should conduct user testing with disabled participants to ensure that their websites are accessible and usable by disabled people”

  • User testing should include users from a range of disabilities and preferences, including a mix of beginners and experienced web users using a range of assistive technologies.

Inadequate definitions/ ambiguities

  • Paragraph 46 suggests testing “ability to bookmark” as part of testing a Web site. That is a browser feature, not a developer-authored feature and thus out-of-scope.

  • Why are Rich Internet Applications separated out? The requirement for sites to work with scripting turned off, etc., is not solely related to RIAs.

Too many trademarks used in examples

We would prefer it if more than one trademark were used as illustrative examples, or none at all, as currently the guidelines erroneously give the impression that only one browser exhibits the qualities being discussed.

For example, we would prefer it if paragraph 50 were redrafted to read, “Certain browsers (e.g., Firefox and Opera) are developed using cross-platform technology (e.g., Java) and, therefore, behave similarly on different operating systems,” or “Certain browsers are developed using cross-platform technology ...”.

Contact details

These comments were written by Bruce Lawson, a Web Evangelist representing Opera Software ASA. Bruce may be contacted via brucel@opera.com for any clarification of these comments.

The perils of browser sniffing

,

Broswer sniffing doesn't work. Browser sniffing may have started out as a way to prevent browsers without proper features from accessing the sites, but now it often keeps browsers away from sites which otherwise would have worked.

In the old days, sniffing was often seen as a necessary way of coping with browser incompatibilities, but it was never meant to be a long-term solution. No sooner did you finish your site, a new version of an old browser came along to break it.

Browser sniffing was invented because different browsers had wildly varying DOMs so authors neeeded to send one script to one browser, and another to a competing browser. The browser incompatabiliites eventually led to the Web Standards movement, which showed that correctly-written specs and technologies that followed them is a more robust way for different browsers to interoperate.

The reason that the old way was not robust was because it was because designing a site should be like designing a car without worrying about driving on incompatible roads. Designers want to master their art, and browsers should make sure designers are given the right to express themselves in a standard way. When browser-of-the-day is not standard compliant, developers will design according to that dominant browser even if it is not compliant. This not only breaks other browsers, but future version of the same browser. So, for example, if Internet Explorer 8 were to run on its "standard mode", it will break many sites that worked fine in previous versions of Internet Explorer.

Browser sniffing also creates a catch-22. In order to access a site that blocks your browser, you made your browser disguise itself as a supported browser. This was done by changing the user agent string that a browser sends the server when it requests the page, so your unsupported browser appeared to the server to be another. And so it became self-perpetuating: when the developer looked at his statistics and realized that he has only one browser visiting the site, he thought that there was no reason to bother designing for other browsers.

Even though that way of working is discredited, and all modern browsers can render sites perfectly if they're made with web standards, some people still use browser sniffing. To get round it, Opera uses user and browser JavaScript to mask ourselves. Google Chrome uses another method. It has the longest user agent string anyone has ever seen, thereby telling the world that it is 1) Mozilla 2) WebKit, 3) KHTML, 4) Gecko, 5) Safari and 6) itself:

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.X.Y.Z Safari/525.13

At Opera our experience is that the majority sites that block us actual worked fine in Opera, and those that don't can be "repaired" with a healthy spoon of standard-compliant code.

The best way forward is to drop browser sniffing and design with web standards in mind. This way your website will run on browsers across the board, and it will work in the future.

Google browser sniffing and the Open Web

, , , ...

As well as being a valuable partner to Opera, with the release of Google Chrome, Google has also become a competitor. We welcome that as more competitors means more innovation, and less likelihood that the Web will be dominated by one single vendor.

However, now Google has become a competitor with its own self interests in promoting its own browser, it brings new responsibility. Google themselves state the following in their Google developer documentation (emphasis mine):

Internet users have an increasing number of choices for web browsers today, including Firefox, Safari, Opera, and now Google Chrome. Sometimes web pages look and work differently in each browser, so it’s important to test your site across all of them to ensure all your visitors can enjoy the experience you’ve designed. – Google Chrome

They also state in Google DocType that is is bad code that checks for browser names:

Since there is so much bad code out there already that does check for specific browser names, some browsers have options to give out false information about who they are. – Google DocType

Why is this important? Well, in these places and others, Google’s developer documentation and PR is telling us that Google believes in the Open Web, we should test in multiple browsers, and browser sniffing is bad. With these statements, and the fact that Google is now a member of the browser market, it is clear that it is important that they do not warn users of their services against using certain browsers, or block them completely, and that they would be against such policies anyway. You could consider it an anti-competitive move if they do so, while allowing access to their own browser.

The reality is though that Google has and continues to block Opera (and other browsers) from accessing their services, or warns against using them. Sometimes for entire services, or sometimes for specific features. Often the only change needed to allow those services to work is to bypass Google’s browser sniffing. It will be telling if Google changes their tune now that Google Chrome has been released. A list of Google sites that currently block or warn against Opera includes, but is not limited to:

  • Google Notebook
  • Google Groups
  • Google Spreadsheets (they have promised to remove the block but this is not live yet
  • Google Presentations
  • Google Picasa
  • Google Sites
  • Blogger (patched in browser.js to allow us to get the rich text editor)
  • Lively

It is not all bad. There are certainly people in Google that are very helpful to Opera, such as the Google GWT team, and in recent weeks and months I’ve been able to find contacts that have fixed issues and removed the browser sniffing that stopped Opera working on properties such as Orkut, Google Docs, and GMail (mobile specific). The Google Spreadsheets team has also recently been helpful and promised to remove the block on that property soon. I look forward to this collaboration continuing, and for Google to stick to the principles they mention on their sites about testing in all browsers. I hope that there is commitment from higher up in Google to make sure that all discrimination against Opera (and other browsers) is removed. If they test their new features and services in Opera, I’d be happy to work with Google and our QA team to look into any problems they find in our browsers that cause them problems.