ソースを参照

Optimize killSticky to only call getComputedStyle once per element

master
saturn 6年前
コミット
6711ae5729
1個のファイルの変更3行の追加3行の削除
  1. 3
    3
      src/contentScript.js

+ 3
- 3
src/contentScript.js ファイルの表示

@@ -60,8 +60,8 @@ function checkForShouldKillSticky(result) {
function killSticky(root) {
root = root || document.querySelector("body");
root.querySelectorAll('*').forEach(element => {
if (getComputedStyle(element).position === 'fixed' ||
getComputedStyle(element).position === 'sticky') {
let position = getComputedStyle(element).position;
if (position === 'fixed' || position === 'sticky') {
// uBlock exception.
if (element.tagName == "IFRAME" &&
element.parentElement.tagName == "HTML")
@@ -139,4 +139,4 @@ function initialize() {
}
});
}
initialize();
initialize();

読み込み中…
キャンセル
保存