Version 0.1.0.
Added infinite scroll to the public Forum threads, and added options page to adjust whether to enable infinite scrolling in thread lists and inside threads separately.
diff --git a/forum_inject.js b/forum_inject.js
index 204c2fc..a2209cd 100644
--- a/forum_inject.js
+++ b/forum_inject.js
@@ -1,3 +1,5 @@
+var intersectionObserver;
+
function intersectionCallback(entries, observer) {
entries.forEach(entry => {
if (entry.isIntersecting) {
@@ -10,5 +12,10 @@
threshold: 1.0
}
-var intersectionObserver = new IntersectionObserver(intersectionCallback, intersectionOptions);
-intersectionObserver.observe(document.querySelector(".thread-list-threads__load-more-button"));
+chrome.storage.sync.get(null, function(items) {
+ var button = document.querySelector(".thread-list-threads__load-more-button");
+ if (items.list && button !== null) {
+ intersectionObserver = new IntersectionObserver(intersectionCallback, intersectionOptions);
+ intersectionObserver.observe(button);
+ }
+});