Hướng dẫn dùng file user.js để sửa nhanh một loạt cấu hình about:config trên Firefox Android không cần root.
TL;DR: Kết nối ADB, dùng Firefox desktop remote debugging Firefox Android, mở một trang about:support trên mobile sau đó từ Console chạy một loạt lệnh có dạng
Services.prefs.set<String|Int|Bool>Pref(pref, val);
để thay đổi config.
Chi tiết:
1. Kết nối ADB giữa thiết bị Android và PC. Cái này ai vọc vạch Android thì đều biết rồi.
View attachment 2071759
2. Bật Remote debugging via USB trong cài đặt của Firefox.
View attachment 2071795
3. Trên Firefox desktop, vào
about:debugging
. Nếu mọi thứ đúng thì thiết bị Android sẽ hiện trong list. Bấm Connect.
View attachment 2071772
4. Connect thành công thì bấm phát nữa vào tên thiết bị. Sẽ hiện ra một list các tabs đang được mở. Mở một tab
about:support
trên Android nếu chưa làm.
View attachment 2071773
5. Bấm Inspect để làm việc với trang about:support. Tại đây bấm chọn tab Console.
View attachment 2071779
6. Paste đoạn code này vào rồi Enter chạy luôn. Đoạn code này overide lại những hàm user_pref mà file user.js gọi.
JavaScript:
var user_pref = function(pref, val){
try {
if(typeof val == "string"){
Services.prefs.setStringPref(pref, val);
}
else if(typeof val == "number"){
Services.prefs.setIntPref(pref, val);
}
else if(typeof val == "boolean"){
Services.prefs.setBoolPref(pref, val);
}
} catch(e){
console.log("pref:" + pref + " val:" + val + " e:" + e);
}
}
//paste your user.js file content here
View attachment 2071783
7. Paste tiếp nội dung file user.js của bạn vào rồi Enter chạy luôn
View attachment 2071793
Và thế là xong. Disconnect các thứ ra và tận hưởng.