Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

Chủ đề này đã đóng và được lưu lại. Vui lòng hỏi một câu hỏi mới nếu bạn cần giúp đỡ.

How to change settings or preferences in firefox source code?

  • 6 trả lời
  • 1 gặp vấn đề này
  • 52 lượt xem
  • Trả lời mới nhất được viết bởi cor-el

more options

I want to change some settings in Firefox from the source code, and I cant figure It out. I Have Heard Of autoconfig but that's for in the directory of Firefox.

I want to change some settings in Firefox from the source code, and I cant figure It out. I Have Heard Of autoconfig but that's for in the directory of Firefox.

Tất cả các câu trả lời (6)

more options

Hi

If you are looking to work with the code of Firefox, this site will help you to get started:

https://firefox-source-docs.mozilla.org/index.html

more options

I have done all of those already, But I want the change the default preferences in firefox.

more options

There is no need to edit the source code to change the default value of a pref. You can do this via a policies.json file or via autoconfig.cfg file in case the pref is not supported by a policy.


To use Autoconfig, place two files into the Firefox installation directory.

  • on Windows, they go into the same directory where Firefox is installed
  • on macOS, they go into the Contents/Resources directory of the Firefox.app

The autoconfig.js file that specifies to use autoconfig.cfg is placed into the "defaults\pref" directory where the channel-prefs.js file is located. The autoconfig.cfg file is placed at the top level of the Firefox directory.

  • autoconfig.cfg and autoconfig.js need to start with a comment line (//)
  • autoconfig.js needs to use Unix line endings (LF instead of CR/LF)

The content of autoconfig.js:

//
pref("general.config.filename", "autoconfig.cfg");
pref("general.config.obscure_value", 0);
pref("general.config.sandbox_enabled", false);

These functions can be used in autoconfig.cfg:

defaultPref();	// set new default value, requires special data: format for localized prefs
pref();	// set pref, allow changes in current session
lockPref();	// lock pref, disallow changes
more options

But i want it to be defaulted so when i build it it always has those settings without having to put these files

more options

I have built firefox using mozillabuild but I want the change the default settings or preferences, for example the homepage or more preferences page. I want to do this directly from the code.

more options

I will lock this thread since you decided to create a new thread.