[Solved] Noscript menu + Mindfield on Linux

Bug reports and enhancement requests
Post Reply
linuser
Junior Member
Posts: 26
Joined: Sun Nov 08, 2009 8:45 pm

[Solved] Noscript menu + Mindfield on Linux

Post by linuser »

NoScript interface stopped to work last week ( empty preferences , empty menu & context menu ) after updating my Mindfield installation, but all preferences , site preferences , otpions were mantained since the status bar icon correctly showed the site blocked or allowed.

After updating NoScript to the latest dev version the options' window returned to be populated correctly with all the fields ( whitelist , script options , ABE, etc ) but the context menu is still not working since it shows always the same options like in the pic , independently of the options selected.

It was so while I still was on Hardy , the same now on Lucid ( I've also updated the xorg package to eventually avoid the X crash BUG )

Image
Last edited by linuser on Fri May 14, 2010 3:46 pm, edited 1 time in total.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.3a5pre) Gecko/20100513 Minefield/3.7a5pre
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: [BUG] Noscript menu + Mindfield on Linux

Post by Giorgio Maone »

It's working for me, same build as yours (Mozilla/5.0 (Windows; U; Windows NT 5.2; WOW64; en-US; rv:1.9.3a5pre) Gecko/20100513 Minefield/3.7a5pre).
Can you turn the javascript.options.showInConsole about:config preference to true and check whether any error message appears in Tools|Error Console when you open the menu?
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
linuser
Junior Member
Posts: 26
Joined: Sun Nov 08, 2009 8:45 pm

Re: [BUG] Noscript menu + Mindfield on Linux

Post by linuser »

Code: Select all

Error: missing argument 0 when calling function Array.slice.apply
Source File: chrome://noscript/content/noscriptOverlay.js
Line: 798
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.3a5pre) Gecko/20100513 Minefield/3.7a5pre
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: [BUG] Noscript menu + Mindfield on Linux

Post by Giorgio Maone »

linuser wrote:

Code: Select all

Error: missing argument 0 when calling function Array.slice.apply
Source File: chrome://noscript/content/noscriptOverlay.js
Line: 798
Thanks for the info, which hints at a bug related to a specific configuration: you've got the "Blocked Objects" menu hidden in NoScript Options|Appearance and NoScript Options|Advanced|External Filters enabled.
I'm fixing that. As a work-around, you should either show the "Blocked Objects" menu or disable the external filters.

[EDIT]
The problem appears to happen anyway if external filters are enabled, but on Minefield only :(
Further investigations needed...
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
linuser
Junior Member
Posts: 26
Joined: Sun Nov 08, 2009 8:45 pm

Re: [BUG] Noscript menu + Mindfield on Linux

Post by linuser »

I think I've got it !

The problem is maybe caused by AdBlock Plus, because I have also this extension in my working profile.

I've tried to install Noscript in a fresh profile : the same message in the js error console but the menu worked correctly.

Then I've imported the same preferences of my working profile : the same error message in the console but the menu still worked.

I've installed AdBlock Plus : the same error message in the console but the menu behaviour is now the same as reported in the first post.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.3a5pre) Gecko/20100513 Minefield/3.7a5pre
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: [BUG] Noscript menu + Mindfield on Linux

Post by Giorgio Maone »

OK, found the culprit.
Looks like, in recent Minefield builds, Array.slice.[call|apply] (the generic method) has a different behavior than Array.prototype.slice.[call|apply]:

Code: Select all

array = [0,1,2,3];
Array.prototype.call(a); // this gives [0,1,2,3] on both Minefield and Firefox 3.6.3
Array.slice.call(a, 0); // this gives "undefined" on Minefield, [0,1,2,3] on Firefox 3.6.3 
Array.slice.call(a); // this gives error on Minefield, [0,1,2,3] on Firefox 3.6.3
This is not a bug, but rather an edge behavior (the generic methods are meant to be called directly, rather than using call/apply) which has been removed, intentionally or not, from recent builds.
I'm gonna fix it by using the "natural" syntax for generic Array methods, i.e.

Code: Select all

Array.slice(a)
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: [BUG] Noscript menu + Mindfield on Linux

Post by al_9x »

I am curious about Array.slice(). Isn't slice an instance method, inherited from Array.prototype? Then Array.slice() shouldn't even exist. Why does it? and why do you use it?

If it does exist and is a function, then how could it not inherit call and apply?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: [BUG] Noscript menu + Mindfield on Linux

Post by Giorgio Maone »

al_9x wrote:I am curious about Array.slice(). Isn't slice an instance method, inherited from Array.prototype? Then Array.slice() shouldn't even exist. Why does it? and why do you use it?
https://developer.mozilla.org/en/New_in ... g_generics

At a certain point (when I dropped Firefox 1.0.x compatibility) I converted all my usages of Array.prototype.method.call() to Array.method(), for convenience and speed (it spares at least one property access). Unfortunately, some instances of the replacements were hybrid, i.e. Array.method.call() rather than directly Array.method(), but everything still worked because, as you said, you could logically expect call() and apply() to work the way they are currently working on Firefox 3.6.3
al_9x wrote: If it does exist and is a function, then how could it not inherit call and apply?
It does inherit both call and apply, they're just not behaving anymore (in Minefield) the way you (and I) could expect them to (and the way they still behave on branch).
As I said, this might be intentional but more probably is the side effect of some other bug fix or performance enhancement (and one could ever argue it's a bug itself, but it doesn't break "generics" behavior as it is specified above).
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

Re: [BUG] Noscript menu + Mindfield on Linux

Post by al_9x »

Didn't know about these generics, thanks. It does kind of make sense, if you go strictly by the standard, that Array.slice.call would expect a meaningless context first arg, and the second arg would be the object to apply to.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: [BUG] Noscript menu + Mindfield on Linux

Post by Giorgio Maone »

al_9x wrote:if you go strictly by the standard, that Array.slice.call would expect a meaningless context first arg, and the second arg would be the object to apply to.
Yes, in Firefox 3.6.3 it behaves like a polymorphic method instead, with the "right" behavior depending on first arg being an array-like object (=generic) or a number/undefined (=instance).
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: [BUG] Noscript menu + Mindfield on Linux

Post by Giorgio Maone »

Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
linuser
Junior Member
Posts: 26
Joined: Sun Nov 08, 2009 8:45 pm

Re: [BUG] Noscript menu + Mindfield on Linux

Post by linuser »

Confirmed.

The latest dev build of NoScript solved the issue.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.3a5pre) Gecko/20100513 Minefield/3.7a5pre
Post Reply