Preferences, Logging and Javascript question
-
- Posts: 45
- Joined: December 3rd, 2005, 9:14 am
Preferences, Logging and Javascript question
I have some questions (for the 1.0 version of my extension):
Preferences: I need help creating a preferences pane in the options menu. How would I add my own buttons to it, and how would I retrieve the values?
Logging: How would I create a logging file?
Javascript: What Javascript is commonly used in extensions? Also, could someone provide me with a sample code of a dialog box? (Eg. Accept and Reject, etc)
Thanks.
Preferences: I need help creating a preferences pane in the options menu. How would I add my own buttons to it, and how would I retrieve the values?
Logging: How would I create a logging file?
Javascript: What Javascript is commonly used in extensions? Also, could someone provide me with a sample code of a dialog box? (Eg. Accept and Reject, etc)
Thanks.
-
- Posts: 846
- Joined: August 4th, 2003, 9:32 am
Here are answers to two of your three questions:
http://kb.mozillazine.org/Creating_dialogs
http://kb.mozillazine.org/File_IO
-grimholtz
http://kb.mozillazine.org/Creating_dialogs
http://kb.mozillazine.org/File_IO
-grimholtz
-
- Posts: 4019
- Joined: November 16th, 2003, 3:05 am
- Location: Russia, Moscow
-
- Posts: 45
- Joined: December 3rd, 2005, 9:14 am
-
- Posts: 4019
- Joined: November 16th, 2003, 3:05 am
- Location: Russia, Moscow
Look at extensions that have preferences.
http://kb.mozillazine.org/Dev_:_Using_preferences - working with prefs from a script
http://developer.mozilla.org/en/docs/Preferences_System - prefwindow (see also xulplanet references)
http://kb.mozillazine.org/Dev_:_Using_preferences - working with prefs from a script
http://developer.mozilla.org/en/docs/Preferences_System - prefwindow (see also xulplanet references)
-
- Posts: 45
- Joined: December 3rd, 2005, 9:14 am
-
- Posts: 45
- Joined: December 3rd, 2005, 9:14 am
-
- Posts: 45
- Joined: December 3rd, 2005, 9:14 am
-
- Posts: 846
- Joined: August 4th, 2003, 9:32 am
How would I get a site to check if Firefox has a particular extension?
I don't think this is possible. At least, I don't know how.
what would be the code for the preference to edit the user-agent string?
This is just a standard preference -- general.useragent.override
Also, if I create a Preferences file, do I need to add any other code to other files?
Not sure I understand. If you create a preferences file in your extension, no, you don't have to write any code to have that file processed. As long as you place it in the right directory within the xpi, it will automatically be processed.
-
- Posts: 45
- Joined: December 3rd, 2005, 9:14 am
-
- Posts: 846
- Joined: August 4th, 2003, 9:32 am
-
- Posts: 0
- Joined: December 31st, 1969, 5:00 pm
grimholtz wrote:what would be the code for the preference to edit the user-agent string?
This is just a standard preference -- general.useragent.override
For Firefox 1.5, it is better to set the pref general.useragent.extra.your_extensions_name_here to the string you want to have appended to the regular user agent. This allows several extensions to add their identifiers without overwriting each others' settings.
Web pages can then simply parse navigator.userAgent for the extension's identifier and behave accordingly (no need for further extension code - and the pref mentioned above can simply be set in the extension's preferences file).
-
- Posts: 45
- Joined: December 3rd, 2005, 9:14 am