views:

25

answers:

2

I would like to modify a file loaded by Firefox on startup (persdict.dat - this is the personal dictionary file).

What code do i need to use in order to enter an additional word into the file before it gets loaded by FireFox on browser startup?

+1  A: 

See https://developer.mozilla.org/en/Code_snippets/File_I%2f%2fO for sample code used to read/write from files. To get the file itself (I have no idea what persdict.dat is), try to find out if it has a chrome:// URL that can be used to access it. Otherwise, I assume it's in either the Firefox installation directory (C:\Program Files\Mozilla Firefox, or whatever) or the user's profile directory. So use the table under "Getting special files."

MatrixFrog
well, i know how to access files, but i do not know how i do it on startup (especially before the spellchecker engine loads the file)
Thariama
+1  A: 

Almost all Firefox extensions are open source. So look for one that does what you need to do and see how they did it. I would guess that most dictionary addons have this feature?

Ruby8848
not a single one (i instpected) has this feature, cause they don't need to load persdict.dat. The Firefox Spellchecker is in the firefox core.
Thariama