Slightly improvement performance on some sites
This commit is contained in:
parent
25a1372a31
commit
ef51b54e54
@ -58,14 +58,13 @@ function checkForShouldKillSticky(result) {
|
|||||||
*/
|
*/
|
||||||
function startConstantVigilance() {
|
function startConstantVigilance() {
|
||||||
var observer = new MutationObserver((mutationsList, observer) => {
|
var observer = new MutationObserver((mutationsList, observer) => {
|
||||||
var shouldKillSticky = false;
|
|
||||||
for (var mutation of mutationsList) {
|
for (var mutation of mutationsList) {
|
||||||
if (getComputedStyle(mutation.target).position == 'fixed' ||
|
if (getComputedStyle(mutation.target).position == 'fixed' ||
|
||||||
getComputedStyle(mutation.target).position == 'sticky')
|
getComputedStyle(mutation.target).position == 'sticky') {
|
||||||
shouldKillSticky = true;
|
mutation.target.remove();
|
||||||
|
console.log("Killing new sticky!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (shouldKillSticky)
|
|
||||||
requestAnimationFrame(() => { killSticky(); });
|
|
||||||
});
|
});
|
||||||
|
|
||||||
observer.observe(document.querySelector("body"), {
|
observer.observe(document.querySelector("body"), {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user