[Project_owners] How to use install.js to write to all.js file?

Chris Neale cdn at mozdev.org
Thu Dec 25 17:48:19 EST 2003


On Thursday 25 December 2003 17:38, Matthew A. McGuigan wrote:
> >
> >stupid question: why ?
>
> I need to write the search mode preference to 1.  I'm currently replacing
> the all.js file just to write this one pref, but I think it may be causing
> some issues and I'm certain it will in the future.  Would like to be able
> to fix it before it becomes a big problem.
>
> Thanks,
>
> Matthew
>
 this ?

user_pref("browser.search.mode", 1);

I have user_pref("browser.search.mode", 0); in user.js

can you not do this when search sidebar starts up ?

var ssPref = Components.classes["@mozilla.org/preferences-service;1"].
                          getService(Components.interfaces.nsIPrefService).
                          getBranch("browser.search.");

ssPref.setBoolPref("mode", 1);

-- 

cdn

--

Extensions for Mozilla-based Applications [ http://cdn.mozdev.org/ ]

get Orbit3+1, Orbit Retro and other Mozilla themes from : 
http://themes.mozdev.org/



More information about the Project_owners mailing list