[Project_owners] Overlaying JS

Neil neil at parkwaycc.co.uk
Tue Oct 18 11:24:46 EDT 2005


Philip Chee wrote:

>On Mon, 17 Oct 2005 10:27:17 +0100, Neil wrote:
>
>>I guess the best way is to find the JS file that defines doSomething, find the XUL file that imports the JS file, overlay that XUL file, import your JS file, and redefine the function. Function declarations are equivalent to variables i.e. function foo(bar) {}; is equivalent to var foo = function foo(bar) {};
>>    
>>
>?!? Shirley, you mean: var foo = function(bar) {};
>  
>
No, function foo(bar) {}; creates a function named foo and assigns it to 
foo in one go. Your code creates an anonymous function.

>So I can just do:
>
>function doSomethingBetter() { betterfoo(); betterbar(); }
>doSomething = doSomethingBetter;
>  
>
That should also work.

>I'm looking at porting the infrastructure needed to support extension XUL sidebars.
>
Sounds like something we'd like checked in on the trunk :-)


More information about the Project_owners mailing list