473,289 Members | 1,756 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,289 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 3060
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: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.