소스 검색

Slightly improvement performance on some sites

master
Said Achmiz 6 년 전
부모
커밋
ef51b54e54
1개의 변경된 파일4개의 추가작업 그리고 5개의 파일을 삭제
  1. 4
    5
      src/contentScript.js

+ 4
- 5
src/contentScript.js 파일 보기

@@ -58,14 +58,13 @@ function checkForShouldKillSticky(result) {
*/
function startConstantVigilance() {
var observer = new MutationObserver((mutationsList, observer) => {
var shouldKillSticky = false;
for (var mutation of mutationsList) {
if (getComputedStyle(mutation.target).position == 'fixed' ||
getComputedStyle(mutation.target).position == 'sticky')
shouldKillSticky = true;
getComputedStyle(mutation.target).position == 'sticky') {
mutation.target.remove();
console.log("Killing new sticky!");
}
}
if (shouldKillSticky)
requestAnimationFrame(() => { killSticky(); });
});

observer.observe(document.querySelector("body"), {

Loading…
취소
저장