If the preference doesn’t exist, it displays an error. GetPref(prefName) – retrieves the value of a preference. As an example, this would be used in case where a preference should be locked for all users, but unlocked for particular users. UnlockPref(prefName) – unlocks a preference. Locking a preference prevents a user from changing it, and in most cases, disables the UI in preferences so it is obvious to the user that the preference has been disabled. LockPref(prefName, value) – sets the default value of a preference and locks it. It can be permanently changed by the user. This is the value that a preference has when the user has not set any value or the user resets the preference. That means that if the user has changed the value, it will get reset every time the browser is started.ĭefaultPref(prefName, value) – sets the default value of a preference. This function explicitly sets the preference as a user preference. Pref(prefName, value) – sets the user value of a preference. The following functions are available within an AutoConfig file: This allows for additional Javascript to be written within the file to add different logic in different situations. cfg, the AutoConfig file is a JavaScript file. IMPORTANT: Start your code on the 2nd lineĪlthough the extension of an AutoConfig file is typically. It should always begin with a commented line, such as: The second file to create is called firefox.cfg and it is placed at the top level of the Firefox directory. By default, Firefox expects the file to be byte shifted by 13 bytes in order to obfuscate it. The second line indicates that the AutoConfig should not be obscured. The name of the file can be customized, but the location of the file cannot be changed. The first line specifies the name of the AutoConfig file. It should contain the following two lines: The first file to create is named autoconfig.js and it must be placed into the defaults/pref directory. The autoconfig.js file must use Unix end-of-line (LF), even on Windows systems with Firefox 60 or higher.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |