Ubufox is broken in Firefox Nightly, due to using no-longer-supported "for each" syntax. Error console now shows "SyntaxError: missing ( after for UpdateNotifier.js:217:8"

Bug #1648649 reported by Daniel Holbert
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubufox (Ubuntu)
Triaged
High
Chris Coulson

Bug Description

Firefox Nightly (53) no longer supports the non-standard "for each" looping construct, as of https://bugzilla.mozilla.org/show_bug.cgi?id=1293305

Unfortunately, ubufox uses this construct, which causes problems as shown in the error console at startup:
> SyntaxError: missing ( after for UpdateNotifier.js:217:8
> SyntaxError: missing ( after for utils.jsm:217:8

Fortunately, it's easy to fix! Just replace code like this...
> for each (let k in [...])
...with code like this:
> for (let k of [...])

Note: I also filed this in Mozilla's bug-tracker (under Tech Evangelism | Add-ons) here:
 https://bugzilla.mozilla.org/show_bug.cgi?id=1322551

Revision history for this message
Daniel Holbert (dholbert) wrote :

I'm using Ubuntu 16.10 with latest Firefox & ubufox.

Package versions:
$ apt-cache show xul-ext-ubufox | grep Version
Version: 3.2-0ubuntu1

$ apt-cache show firefox | grep Version
Version: 50.0.2+build1-0ubuntu0.16.10.1

Revision history for this message
Daniel Holbert (dholbert) wrote :

[CC'ing Alexander, Arzhel/xionox, & Chris, who are all listed as "Contributors" at the top of UpdateNotifier.js, one of the affected JS files. Hoping one of them can address this or might know who can.]

Revision history for this message
Chris Coulson (chrisccoulson) wrote :

Thanks for reporting this. I'm on vacation now until January, but I'll get this fixed when I return

Changed in ubufox (Ubuntu):
assignee: nobody → Chris Coulson (chrisccoulson)
importance: Undecided → High
Revision history for this message
Daniel Holbert (dholbert) wrote :

Great, thanks Chris!

Note: I am not a JS expert, so my suggested replacement in comment 0 might not be exactly right for all cases of this pattern. (I believe it's correct for code that's iterating over a JS array, but the semantics might be slightly different for other structures, e.g. whether you're iterating over keys vs. values, etc. This definitely merits a sanity-check test (e.g. logging each iterated entry before/after the change) to be sure the conversion is valid.)

Changed in ubufox (Ubuntu):
status: New → Triaged
Revision history for this message
Daniel Holbert (dholbert) wrote :

Hi Chris! I'm still seeing this issue (in latest Firefox Nightly), BTW. I'm also noticing that "about:startpage" (the default homepage imposed by the extension) does not load in affected versions, possibly due to this same issue.

Also: there's one more step that you need to perform before you can test this in Nightly now: you have to set the about:config pref "extensions.allow-non-mpc-extensions" to "true". Otherwise, the Ubuntu Modifications extension will get auto-disabled, as described in https://bugzilla.mozilla.org/show_bug.cgi?id=1364978

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.