blob: a2209cd9613799551b84fcf98133d2989c59fe8e [file] [log] [blame]
avm99963cbea3142019-03-28 00:48:15 +01001var intersectionObserver;
2
avm99963847ee632019-03-27 00:57:44 +01003function intersectionCallback(entries, observer) {
avm99963847ee632019-03-27 00:57:44 +01004 entries.forEach(entry => {
5 if (entry.isIntersecting) {
6 entry.target.click();
7 }
8 });
9};
10
11var intersectionOptions = {
12 threshold: 1.0
13}
14
avm99963cbea3142019-03-28 00:48:15 +010015chrome.storage.sync.get(null, function(items) {
16 var button = document.querySelector(".thread-list-threads__load-more-button");
17 if (items.list && button !== null) {
18 intersectionObserver = new IntersectionObserver(intersectionCallback, intersectionOptions);
19 intersectionObserver.observe(button);
20 }
21});