Closed Bug 542104 Opened 14 years ago Closed 14 years ago

[HTML5] Page doesn't load with HTML5.enable=true and "Firefox" in the UA string

Categories

(Tech Evangelism Graveyard :: English US, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: u88484, Unassigned)

References

()

Details

(Keywords: regression)

The linked page doesn't load with HTML5.enabled;true and a modified UA string.  I have added 'general.useragent.extra.release' with a value of 'Firefox/3.6'.

The page loads fine with that added UA preference with HTML5 disabled but doesn't with HTML5 enabled.  The page loads fine without the added UA portion and with HTML5 enabled/disabled.

Something with the HTML5 enabled combination and what seems like any addition to the UA causes the page not to load.

Another user has appended the default 'general.useragent.extra.firefox' to add ' Firefox/3.6' (with the space) after the 'Minefield/3.7a1pre' string and has the same results.  All of the above results can not be reproduced with Firefox 3.6, the page loads correctly no matter what.

It seems as if the page is hanging on loading ajax.googleapis.com
The two scripts loading from ajax.googleapis.com are:

http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js
http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.1/scriptaculous.js?load=builder,effects

First link has some UA sniffing going on:

var Prototype = {
  Version: '1.6.0.2',

  Browser: {
    IE:     !!(window.attachEvent && !window.opera),
    Opera:  !!window.opera,
    WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
    Gecko:  navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1,
    MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
  },

and later on:

      /* Force "Connection: close" for older Mozilla browsers to work
       * around a bug where XMLHttpRequest sends an incorrect
       * Content-length header. See Mozilla Bugzilla #246651.
       */
      if (this.transport.overrideMimeType &&
          (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
            headers['Connection'] = 'close';

and:

else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) {
  Element.Methods.setOpacity = function(element, value) {
    element = $(element);
    element.style.opacity = (value == 1) ? 0.999999 :
      (value === '') ? '' : (value < 0.00001) ? 0 : value;
    return element;
  };


The second link doesn't appear to have any UA sniffing (searched source code for gecko and firefox.
Priority: -- → P2
Summary: Page doesn't load with HTML5.enabled;true and a modified UA string → [HTML5] Page doesn't load with HTML5.enabled;true and a modified UA string
If navigator.userAgent.toLowerCase() contains "firefox", the site decides the browser is Firefox. If the site has decided that the browser is Firefox, it attaches its script libraries using DOM manipulation as opposed to document.write().

Of the script libraries, at least http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.1/scriptaculous.js?load=builder,effects calls document.write itself. However, since the script has been attached via DOM manipulation, by the time the script has loaded an runs, "insertion point" per HTML5 spec is undefined and the document.write() call implies a document.open() call that blows away the current document (like IE would do).

The site could fix itself by removing the check for Firefox and letting Firefox run the same code that other browsers (incl. IE and Minefield) get.
Assignee: nobody → english-us
Component: HTML: Parser → English US
Priority: P2 → --
Product: Core → Tech Evangelism
QA Contact: parser → english-us
Summary: [HTML5] Page doesn't load with HTML5.enabled;true and a modified UA string → [HTML5] Page doesn't load with HTML5.enable=true and "Firefox" in the UA string
Version: Trunk → unspecified
The site hasn't responded or fixed itself, but the landing of bug 560256 mitigates the user-visible effects sufficiently, so I think it's not worthwhile to pursue contacting the site.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.