kiến thức Tổng hợp những addon chất cho Firefox / Chromium

Đây thím, xem giúp em với =((
Addon nhìn ok hết, cho mình hỏi tổng lượng RAM là bao nhiêu với lại antivirus là gì, vì thằng Windows Defender nó chơi xấu Firefox phải đặt ngoại lệ cả folder profile với folder cài đặt mới hết, đây là bài viết về vụ WD: https://voz.vn/t/tong-hop-nhung-addon-chat-cho-firefox-pc-mobile.682181/post-22938382

Ngoài ra Firefox nó có cái about:config là trim on minimize: http://kb.mozillazine.org/Config.trim_on_minimize

Nếu bạn có bật lên thì vào tắt đi nhé vì nó ép Firefox giải phóng RAM khi chuyển qua lại ứng dụng. :D
Nếu bạn có từng chỉnh about:config thì cho mình biết, nếu đây là khả năng thì nên thử tạo một profile mới trong about:profiles, rồi thử dùng một lúc chuyển qua notepad rồi theo dõi xem, nếu không bị thì sẽ dễ truy ra nguyên nhân hơn.
 
Last edited:
Không thím ợ, reg nick trial xong mở full report đọc nó ko cho copy, đoạn thím copy chỉ là phần mở đầu thôi :big_smile:
Mình không có tài khoản nên không test cơ mà mình có thằng bookmarklet này dùng bao lâu nay chưa thấy thua trang nào cả:

https://pastebin.com/NUQ5TKku

New Bookmark rồi làm như sau:

xJx1kEU.png


Khi vào trang nào không cho copy thì ấn vào nó để kích hoạt, nó hoạt động như một cái nút ấn vậy. Mã nguồn gốc nếu bạn muốn biến nó thành Userscript, cứ thử xem ok không đã, nếu được cho mình trang khác test thử chứ trang này thấy đăng ký còn bắt đưa số điện thoại ngại lắm :D

Code:
    var hook_eventNames = "contextmenu|select|selectstart|copy|cut|dragstart".split("|");
var unhook_eventNames = "mousedown|mouseup|keydown|keyup".split("|");
var eventNames = hook_eventNames.concat(unhook_eventNames);
var storageName = getRandStr('qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM', parseInt(Math.random() * 12 + 8));
var EventTarget_addEventListener = EventTarget.prototype.addEventListener;
var document_addEventListener = document.addEventListener;
var Event_preventDefault = Event.prototype.preventDefault;

function addEventListener(type, func, useCapture) {
  var _addEventListener = this === document ? document_addEventListener : EventTarget_addEventListener;
  if(hook_eventNames.indexOf(type) >= 0) {
    _addEventListener.apply(this, [type, returnTrue, useCapture]);
  } else if(unhook_eventNames.indexOf(type) >= 0) {
    var funcsName = storageName + type + (useCapture ? 't' : 'f');

    if(this[funcsName] === undefined) {
      this[funcsName] = [];
      _addEventListener.apply(this, [type, useCapture ? unhook_t : unhook_f, useCapture]);
    }

    this[funcsName].push(func)
  } else {
    _addEventListener.apply(this, arguments);
  }
}

function clearLoop() {
  var elements = getElements();

  for(var i in elements) {
    for(var j in eventNames) {
      var name = 'on' + eventNames[j];
      if(elements[i][name] != null && elements[i][name] != onxxx) {
        if(unhook_eventNames.indexOf(eventNames[j]) >= 0) {
          elements[i][storageName + name] = elements[i][name];
          elements[i][name] = onxxx;
        } else {
          elements[i][name] = null;
        }
      }
    }
  }
}

function returnTrue(e) {
  return true;
}
function unhook_t(e) {
  return unhook(e, this, storageName + e.type + 't');
}
function unhook_f(e) {
  return unhook(e, this, storageName + e.type + 'f');
}
function unhook(e, self, funcsName) {
  var list = self[funcsName];
  for(var i in list) {
    list[i](e);
  }

  e.returnValue = true;
  return true;
}
function onxxx(e) {
  var name = storageName + 'on' + e.type;
  this[name](e);

  e.returnValue = true;
  return true;
}

function getRandStr(chs, len) {
  var str = '';

  while(len--) {
    str += chs[parseInt(Math.random() * chs.length)];
  }

  return str;
}

function getElements() {
  var elements = Array.prototype.slice.call(document.getElementsByTagName('*'));
  elements.push(document);

  return elements;
}

function addStyle(css) {
  var style = document.createElement('style');
  style.innerHTML = css;
  document.head.appendChild(style);
}

function init() {
    setInterval(clearLoop, 30 * 1000);
  setTimeout(clearLoop, 2500);
  window.addEventListener('load', clearLoop, true);
  clearLoop();

    EventTarget.prototype.addEventListener = addEventListener;
  document.addEventListener = addEventListener;

    Event.prototype.preventDefault = function() {
    if(eventNames.indexOf(this.type) < 0) {
      Event_preventDefault.apply(this, arguments);
    }
  };
  
    Event.prototype.__defineSetter__('returnValue', function() {
    if(this.returnValue != true && eventNames.indexOf(this.type) >= 0) {
      console.log(this);
      this.returnValue = true;
    }
  });

  console.debug('storageName:' + storageName);

    addStyle('html, * {-webkit-user-select:text!important; -moz-user-select:text!important;}');
}

init();
 
Mình không có tài khoản nên không test cơ mà mình có thằng bookmarklet này dùng bao lâu nay chưa thấy thua trang nào cả:

https://pastebin.com/NUQ5TKku

New Bookmark rồi làm như sau:

xJx1kEU.png


Khi vào trang nào không cho copy thì ấn vào nó để kích hoạt, nó hoạt động như một cái nút ấn vậy. Mã nguồn gốc nếu bạn muốn biến nó thành Userscript, cứ thử xem ok không đã, nếu được cho mình trang khác test thử chứ trang này thấy đăng ký còn bắt đưa số điện thoại ngại lắm :D

Code:
    var hook_eventNames = "contextmenu|select|selectstart|copy|cut|dragstart".split("|");
var unhook_eventNames = "mousedown|mouseup|keydown|keyup".split("|");
var eventNames = hook_eventNames.concat(unhook_eventNames);
var storageName = getRandStr('qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM', parseInt(Math.random() * 12 + 8));
var EventTarget_addEventListener = EventTarget.prototype.addEventListener;
var document_addEventListener = document.addEventListener;
var Event_preventDefault = Event.prototype.preventDefault;

function addEventListener(type, func, useCapture) {
  var _addEventListener = this === document ? document_addEventListener : EventTarget_addEventListener;
  if(hook_eventNames.indexOf(type) >= 0) {
    _addEventListener.apply(this, [type, returnTrue, useCapture]);
  } else if(unhook_eventNames.indexOf(type) >= 0) {
    var funcsName = storageName + type + (useCapture ? 't' : 'f');

    if(this[funcsName] === undefined) {
      this[funcsName] = [];
      _addEventListener.apply(this, [type, useCapture ? unhook_t : unhook_f, useCapture]);
    }

    this[funcsName].push(func)
  } else {
    _addEventListener.apply(this, arguments);
  }
}

function clearLoop() {
  var elements = getElements();

  for(var i in elements) {
    for(var j in eventNames) {
      var name = 'on' + eventNames[j];
      if(elements[i][name] != null && elements[i][name] != onxxx) {
        if(unhook_eventNames.indexOf(eventNames[j]) >= 0) {
          elements[i][storageName + name] = elements[i][name];
          elements[i][name] = onxxx;
        } else {
          elements[i][name] = null;
        }
      }
    }
  }
}

function returnTrue(e) {
  return true;
}
function unhook_t(e) {
  return unhook(e, this, storageName + e.type + 't');
}
function unhook_f(e) {
  return unhook(e, this, storageName + e.type + 'f');
}
function unhook(e, self, funcsName) {
  var list = self[funcsName];
  for(var i in list) {
    list[i](e);
  }

  e.returnValue = true;
  return true;
}
function onxxx(e) {
  var name = storageName + 'on' + e.type;
  this[name](e);

  e.returnValue = true;
  return true;
}

function getRandStr(chs, len) {
  var str = '';

  while(len--) {
    str += chs[parseInt(Math.random() * chs.length)];
  }

  return str;
}

function getElements() {
  var elements = Array.prototype.slice.call(document.getElementsByTagName('*'));
  elements.push(document);

  return elements;
}

function addStyle(css) {
  var style = document.createElement('style');
  style.innerHTML = css;
  document.head.appendChild(style);
}

function init() {
    setInterval(clearLoop, 30 * 1000);
  setTimeout(clearLoop, 2500);
  window.addEventListener('load', clearLoop, true);
  clearLoop();

    EventTarget.prototype.addEventListener = addEventListener;
  document.addEventListener = addEventListener;

    Event.prototype.preventDefault = function() {
    if(eventNames.indexOf(this.type) < 0) {
      Event_preventDefault.apply(this, arguments);
    }
  };
 
    Event.prototype.__defineSetter__('returnValue', function() {
    if(this.returnValue != true && eventNames.indexOf(this.type) >= 0) {
      console.log(this);
      this.returnValue = true;
    }
  });

  console.debug('storageName:' + storageName);

    addStyle('html, * {-webkit-user-select:text!important; -moz-user-select:text!important;}');
}

init();
Link pastebin not available rồi thím. Cái web kia điền bừa sđt khớp mã quốc gia với location là được, ko có OTP đâu
 
Last edited:
Addon nhìn ok hết, cho mình hỏi tổng lượng RAM là bao nhiêu với lại antivirus là gì, vì thằng Windows Defender nó chơi xấu Firefox phải đặt ngoại lệ cả folder profile với folder cài đặt mới hết, đây là bài viết về vụ WD: https://voz.vn/t/tong-hop-nhung-addon-chat-cho-firefox-pc-mobile.682181/post-22938382

Ngoài ra Firefox nó có cái about:config là trim on minimize: http://kb.mozillazine.org/Config.trim_on_minimize

Nếu bạn có bật lên thì vào tắt đi nhé vì nó ép Firefox giải phóng RAM khi chuyển qua lại ứng dụng. :D
Nếu bạn có từng chỉnh about:config thì cho mình biết, nếu đây là khả năng thì nên thử tạo một profile mới trong about:profiles, rồi thử dùng một lúc chuyển qua notepad rồi theo dõi xem, nếu không bị thì sẽ dễ truy ra nguyên nhân hơn.
Cảm ơn thím nhiều, em đặt ngoại lệ cho cả 2 folder sau đó tắt hẳn WD thì có vẻ ngon rồi. Tóm lại là cũng do thằng WD mà ra :cry:
 
Cảm ơn thím nhiều, em đặt ngoại lệ cho cả 2 folder sau đó tắt hẳn WD thì có vẻ ngon rồi. Tóm lại là cũng do thằng WD mà ra :cry:
Nỗi khổ khi là người dùng Firefox đó bạn, người nước ngoài kêu trời mà Microsoft không buông tha, 5 năm trời gửi report 5 năm trời không có kết quả, Chrome nó thậm chí chả gửi phát nào Microsoft nó tự nguyện ngoại lệ luôn cho Chrome.

Mình sẽ tóm tắt lại diễn biến trận chiến:

Chả giải quyết được gì, chỉ biết quặn bụng chịu đau, bao nhiêu người bực quá bỏ Firefox vì người dùng họ không biết cội nguồn lý do, cứ dùng Firefox trên Windows bị thằng WD nó scan cho chậm như rùa mặc dù Firefox không hề chậm, chẳng qua 30-50% hiệu năng bị cha WD nó ghìm lại rồi như đeo quả tạ trên người.
 
Last edited:
Nỗi khổ khi là người dùng Firefox đó bạn, người nước ngoài kêu trời mà Microsoft không buông tha, 5 năm trời gửi report 5 năm trời không có kết quả, Chrome nó thậm chí chả gửi phát nào Microsoft nó tự nguyện ngoại lệ luôn cho Chrome.

Mình sẽ tóm tắt lại diễn biến trận chiến:

Chả giải quyết được gì, chỉ biết quặn bụng chịu đau, bao nhiêu người bực quá bỏ Firefox vì người dùng họ không biết cội nguồn lý do, cứ dùng Firefox trên Windows bị thằng WD nó scan cho chậm như rùa mặc dù Firefox không hề chậm, chẳng qua 30-50% hiệu năng bị cha WD nó ghìm lại rồi như đeo quả tạ trên người.
Firefox của em bị hiện tượng sau khi khởi động thì mở web đầu tiên chậm vl.
Tắt telemetry (theo hướng dẫn của fen) thì có đỡ hơn. Cache cũng chuyển lên RAM (theo hướng dẫn của fen). Nhưng dạo này lại chậm lại rồi. Xin cách khắc phục ợ :pudency:
Ko biết phải do zalo ko nữa :pudency:
 
Firefox của em bị hiện tượng sau khi khởi động thì mở web đầu tiên chậm vl.
Tắt telemetry (theo hướng dẫn của fen) thì có đỡ hơn. Cache cũng chuyển lên RAM (theo hướng dẫn của fen). Nhưng dạo này lại chậm lại rồi. Xin cách khắc phục ợ :pudency:
Ko biết phải do zalo ko nữa :pudency:
Phải thử debug xem sao, liệt kê danh sách addon copy trong about:support
Cách thử tốt nhất là about:profiles -> Restart with addons disabled, load thử trang web đầu tiên xem có chậm không, sau đó tiếp tục debug sau.
 
Vậy thì có thể do config của Firefox, giờ tắt vào about:support, Open Profile Folder rồi tắt Firefox đi, đổi tên file prefs.js thành prefs2.js rồi mở lại Firefox, test tiếp như trên.

Nếu không bị => Do cấu hình Firefox
Nếu bị thì đổi về lại prefs.js rồi tính tiếp.

Nếu vẫn bị khả năng lớn là do ứng dụng thứ ba như WD, mấy thằng AV, tệ nhất là virus.
 
Vậy thì có thể do config của Firefox, giờ tắt vào about:support, Open Profile Folder rồi tắt Firefox đi, đổi tên file prefs.js thành prefs2.js rồi mở lại Firefox, test tiếp như trên.

Nếu không bị => Do cấu hình Firefox
Nếu bị thì đổi về lại prefs.js rồi tính tiếp.

Nếu vẫn bị khả năng lớn là do ứng dụng thứ ba như WD, mấy thằng AV, tệ nhất là virus.
Móe, đổi sang pref2.js mở lên nó thành firefox mới cài búa xua extension :after_boom:
Vẫn bị fen.
Ko phải do bên thứ 3 đâu vì dùng Firefox portable thì ko bị, chắc do profile ít dữ liệu.

1679844766285.png
 
Firefox của em bị hiện tượng sau khi khởi động thì mở web đầu tiên chậm vl.
Tắt telemetry (theo hướng dẫn của fen) thì có đỡ hơn. Cache cũng chuyển lên RAM (theo hướng dẫn của fen). Nhưng dạo này lại chậm lại rồi. Xin cách khắc phục ợ :pudency:
Ko biết phải do zalo ko nữa :pudency:
xóa bớt history đi là hết
 
Móe, đổi sang pref2.js mở lên nó thành firefox mới cài búa xua extension :after_boom:
Vẫn bị fen.
Ko phải do bên thứ 3 đâu vì dùng Firefox portable thì ko bị, chắc do profile ít dữ liệu.

View attachment 1741371
Vờ cờ cờ, 2GB zalo thì đúng là do nó rồi, clear History đi thôi :D
Cái này là nó lưu vào Offline Cache đó, phải chọn phần này mới sạch nhé:

yWWpx8G.png
 
history thì tuần nào cũng xóa, mà xóa all luôn chứ ko phải bớt
thế fen vào folder profile của nó, kiếm file places.sqlite rename đi rồi bật lại firefox xem, t cũng hay bị chậm vậy, xóa nó đi là hết, nhớ bật sync để nó sync ngược lại mấy cái bookmark. Vì xóa file này xóa luôn cả bookmark
 
Vờ cờ cờ, 2GB zalo thì đúng là do nó rồi, clear History đi thôi :D
Cái này là nó lưu vào Offline Cache đó, phải chọn phần này mới sạch nhé:

yWWpx8G.png
ai lại bày dại kiểu đó fen
M7EYXjT.png

Với zalo thì như thế quá bình thường. Ở comment đầu mình có nói rồi.
 
Back
Top