473,386 Members | 1,708 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Writing Firefox's prefs.js with javascript

Firefox's configuration settings (Prefs.js) can be accomplished via the
interface at about:config.

Q1. Is there any such setting that can be repeatedly altered via
javascript (in a vanilla security environment), without having to
request preivileges? By altered, I mean having it remain in effect the
next time Firefox is restarted.

Q2. If the answer to Q1 is affirmative, is there any such setting that
could have an event associated with it so that a page could trap for
such event?

Thanks,
Csaba Gabor from Vienna

Feb 24 '06 #1
3 3062
Csaba Gabor said the following on 2/24/2006 8:55 AM:
Firefox's configuration settings (Prefs.js) can be accomplished via the
interface at about:config.

Q1. Is there any such setting that can be repeatedly altered via
javascript (in a vanilla security environment), without having to
request preivileges? By altered, I mean having it remain in effect the
next time Firefox is restarted.


I surely hope not. I don't want script changing my preferences :)

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 24 '06 #2
Csaba Gabor wrote:
Firefox's configuration settings (Prefs.js) can be accomplished
via the interface at about:config.

Q1. Is there any such setting that can be repeatedly altered
via javascript (in a vanilla security environment), without
having to request preivileges? By altered, I mean having it
remain in effect the next time Firefox is restarted.
Wouldn't that completely undermine the whole purpose of user
configuration, and blow a huge hole in the browser's security?
Q2. If the answer to Q1 is affirmative, is there any such
setting that could have an event associated with it so that
a page could trap for such event?


In the event that the answer to Q1 was ever affirmative that significant
bug could be expected to be fixed in very short order.

Richard.
Feb 24 '06 #3
Richard Cornford wrote:
Csaba Gabor wrote:
Firefox's configuration settings (Prefs.js) can be accomplished
via the interface at about:config.

Q1. Is there any such setting that can be repeatedly altered
via javascript (in a vanilla security environment), without
having to request preivileges? By altered, I mean having it
remain in effect the next time Firefox is restarted.


Wouldn't that completely undermine the whole purpose of user
configuration, and blow a huge hole in the browser's security?


Well, shoot, I just can't slip anything past you guys ;)

I tend to agree with you, but I found something interesting after I
installed GreaseMonkey. [For those not aware: GreaseMonkey is a
Firefox extension that allows one to run custom javascript (on your
local hard drive) whenever you encounter predesignated web pages. For
example, one might remove ads from the page, whenever one visits
yahoo.com].

GreaseMonkey allows you to set values that survive across invocations
of a given script (and are accessible only to that script). It does
this by writing the prefs.js file! Of course this doesn't exactly
match the conditions that I originally stated (vanilla security
environment).

The real motivation for my question is that I would like to be able to
hook into an event (via a GM script) so I can run a function when the
same GM script (even on a different page) has changed such a prefs.js
value. Of course, I could always monitor the value via
window.setInterval(...), but event driven would be much cleaner.

Evidently there is such a mechanism, described at:
http://kb.mozillazine.org/Dev_:_Usin...nces_observers
However (being totally new to XUL, XPCOM, and extensions), from my
initial read and testing, the indicated script (note that last line
references the wrong variable) needs to be in an extension (as opposed
to just being in a <script> element on a page. I would love to be
corrected on this, even if it means having to alter a security setting
on Firefox.

But regardless of whether this event driven prefs.js monitoring is
possible from a GM script / <script> element, I would also like to get
a recommendation for a tutorial or simplest example of being able to
declare custom functions that will allow me to utilize the example's
scripts. Sort of like a "Hello World" thing. There are nice tutorials
at http://www.xulplanet.com/references/...eferences.html
but these seem like a lot more than what I'm after right now.

Csaba
Q2. If the answer to Q1 is affirmative, is there any such
setting that could have an event associated with it so that
a page could trap for such event?


In the event that the answer to Q1 was ever affirmative that significant
bug could be expected to be fixed in very short order.

Richard.


Feb 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: yer.lys | last post by:
When I print my web page the background image shrinks severly when I print from Firefox, but when I print in IE it cuts it like I would expect it to. Is this a bug or is there a mistake in my code...
12
by: Howard Kaikow | last post by:
Yesterday, I decided to try Firefox. I've encountered a behavior that is either a bug in Firefox or a bug in my Javascript code. I'll try to explain the problem, hoping that this newsgroup can...
8
by: Dominic Tocci | last post by:
I'm searching for a way to use window.open on my web page to open a window in firefox that allows the sidebars to work (bookmarks, history, etc). When I use the following: var...
4
by: petermichaux | last post by:
Hi, I'm hoping for a reason I'm wrong or an alternate solution... I'd like to be able to dynamically include some javascript files. This is like scriptaculous.js library but their solution is...
11
by: Alex.Svetos | last post by:
Hello, I'm trying to get a popup to keep focus when it is re-clicked. The script below is supposed to produce this exact behaviour, however it doesn't work, at least on firefox 1.0.7 and moz...
5
by: Kevin Walzer | last post by:
I want to write some variables (user preferences, specifically) to a text file and then read the values from that file. Here is my code to write the data: verbosemodes= """ Detailed = "-vv"...
4
by: Daniel Guettler | last post by:
I'm getting lots of "Error: too much recursion" in my Firefox Error Console I have created these little files to test it. It justs opens a new window and closes it again. I see plenty of errors...
3
by: SAL | last post by:
Hello, I did google this issue and found some stuff related to BrowserCaps section of either web.config or machine.config but it didn't work. It seems that most pages in my webapp are okay but a...
5
by: GhOsTTeCh | last post by:
as title says i wish to change the value of a textfield in the current website. Basicly it enters a certan user and pass on a certan website, both will be stoerd in the prefrences. then the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.