Firefox c2 loadingprogress NaN

Bugs will be moved here once resolved.

Post » Thu Feb 11, 2016 7:07 pm

Problem Description
C2 Runtime loadingprogress variable corrupted as NaN on Firefox since the Gecko engine does not report
e["loaded"] / e["total"]

Attach a Capx
____ Upload a Capx to this post ____

Description of Capx
____ Concise description of what this CapX does ____

Steps to Reproduce Bug
  • Step 1
  • Step 2
  • Step 3 etc.

Observed Result
Loading layout Progress indicator doesn't increase, can not be used to reliably identify loading progress

Expected Result
Code in c2runtime, should have a special condition for firefox, as the properties e["loaded"] / e["total"] are not available

if (typeof window.applicationCache !== "undefined")
{
window.applicationCache.addEventListener('updateready', function() {
self.runtime.loadingprogress = 1;
self.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnUpdateReady, self);
});
window.applicationCache.addEventListener('progress', function(e) {
self.runtime.loadingprogress = e["loaded"] / e["total"];
});
}


Affected Browsers

  • FireFox: (YES)

Operating System and Service Pack
PC

Construct 2 Version ID
2r221 and earlier
B
5
S
1
Posts: 10
Reputation: 419

Post » Fri Feb 12, 2016 2:13 pm

I've changed the next build to return 0 in this case instead. Note the loading progress is not always guaranteed to be available, e.g. if the server does not provide the Content-Length header.
Scirra Founder
B
378
S
219
G
84
Posts: 23,863
Reputation: 187,909


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests