Page 1 of 1

NoScript 2.9/2.9.0.1rc1 doesn't work in Nightly 20160107

Posted: Thu Jan 07, 2016 4:35 pm
by GH113
Hello!
STR:
Create new profile, install NoScript, restart
After restart the following message is shown:
Image
Go to any webpage that uses scripts, for ex. http://www.vimeo.com
Scripts are supposed to be blocked but they are not.

Re: NoScript 2.9/2.9.0.1rc1 doesn't work in Nightly 20160107

Posted: Thu Jan 07, 2016 4:40 pm
by barbaz
Please check the Browser Console (Ctrl-Shift-J) when this issue happens (after adding NoScript XPI, both before and after restart browser) and post here any related messages.
(if you don't know what's related, turn off CSS warnings and post everything else you see)

In the mean time I will look through the NoScript source code to see if I can spot what triggers this message.

Re: NoScript 2.9/2.9.0.1rc1 doesn't work in Nightly 20160107

Posted: Thu Jan 07, 2016 4:47 pm
by Giorgio Maone
They broke the generator syntax with the (deprecated) for...each loop.
I'm finally forced to switch all the loops to for...of, which means raising the lowest Gecko compatible version from 3.0.1 to 13.

Re: NoScript 2.9/2.9.0.1rc1 doesn't work in Nightly 20160107

Posted: Thu Jan 07, 2016 4:56 pm
by barbaz
Ah, Giorgio beat me to replying back.

For future reference, that alert means this code (in chrome://noscript/content/noscript.js) failed

Code: Select all

  get service() {
    var ns = null;
    for(var attempt=1; attempt <= 2 ;attempt++) {
      try {
        ns = Components.classes["@maone.net/noscript-service;1"].getService().wrappedJSObject;
        break;
      } catch(ex) {
        dump(ex.message);
        window.navigator.plugins.refresh();
      }
    }
    if(ns != null) {
      ns.init();
    }
    delete this.service;
    return this.service = ns;
  },

Re: NoScript 2.9/2.9.0.1rc1 doesn't work in Nightly 20160107

Posted: Thu Jan 07, 2016 6:14 pm
by koron

Re: NoScript 2.9/2.9.0.1rc1 doesn't work in Nightly 20160107

Posted: Thu Jan 07, 2016 6:48 pm
by Giorgio Maone
Fixed in latest development build 2.9.0.1rc2, thanks.

Re: NoScript 2.9/2.9.0.1rc1 doesn't work in Nightly 20160107

Posted: Fri Jan 08, 2016 3:24 am
by Thrawn
Giorgio Maone wrote:I'm finally forced to switch all the loops to for...of, which means raising the lowest Gecko compatible version from 3.0.1 to 13.
Hmm...that's a shame, in some ways, although I expect that there's no way to really secure Firefox 3.0 anyway.

Just hypothetically, since JavaScript is interpreted, is it possible to implement some kind of feature detection and use the appropriate loop syntax for the platform?

Re: NoScript 2.9/2.9.0.1rc1 doesn't work in Nightly 20160107

Posted: Fri Jan 08, 2016 3:31 am
by barbaz
Thrawn wrote:Just hypothetically, since JavaScript is interpreted, is it possible to implement some kind of feature detection and use the appropriate loop syntax for the platform?
I can't test now, but would this idea work?

Code: Select all

try {
  let unimportant_iterable = [2,3];
  for (let item of unimportant_iterable) {
    item+= 2;
  }
} catch(e){
    // for-of loop unsupported
}