]> khamidou — GitHub mirrors - infinity-pools.git/commitdiff
Add support for Chrome and Firefox
authorKarim Hamidou <khamidou@gmail.com>
Fri, 29 Dec 2017 15:43:34 +0000 (16:43 +0100)
committerKarim Hamidou <khamidou@gmail.com>
Fri, 29 Dec 2017 15:43:34 +0000 (16:43 +0100)
README.md
manifest.json [new file with mode: 0644]
start.js

index 74a85aa25fcb8e82144799a4a55c4e66504d86b4..5941152a19307794cb12bee27ff8cb950d25d405 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1 +1,3 @@
 # infinity-pools
+
+This is a tiny tiny safari extension which blocks various [infinity pools](https://medium.com/time-dorks/distractions-are-a-nuisance-but-infinity-pools-are-the-real-problem-e84122d62c0c) – that is, website with infinite feeds like Facebook or Pocket's recommended articles page.
diff --git a/manifest.json b/manifest.json
new file mode 100644 (file)
index 0000000..80dff45
--- /dev/null
@@ -0,0 +1,19 @@
+{
+  "manifest_version": 2,
+  "name": "Infinity Pools",
+  "version": "1.0",
+
+  "description": "An extension to hide various feeds like Facebook's, Pocket, etc. ",
+  "applications": {
+     "gecko": {
+        "id": "infinitypools@khamidou.com"
+     }
+  },
+
+  "content_scripts": [
+    {
+      "matches": ["*://*.facebook.com/*", "*://*.getpocket.com/*"],
+      "js": ["start.js"]
+    }
+  ]
+}
index 1e610a065cad78b6538af90919c2f20123acc754..0b2d456bc882cf094c570d97c13b0cfab912f0a0 100644 (file)
--- a/start.js
+++ b/start.js
@@ -12,8 +12,8 @@ var hideFacebookFeed = function() {
 }
 
 
-var hidePocketFeed = function() {
-  var divs = document.getElementsByClassName("queue_togglesection_recommended");
+var hideAll = function(className) {
+  var divs = document.getElementsByClassName();
   for (var i = 0; i < divs.length; i++) {
     var div = divs[i];
 
@@ -21,6 +21,11 @@ var hidePocketFeed = function() {
       div.remove();
     }
   }
+};
+
+var hidePocketFeed = function() {
+  hideAll("queue_togglesection_recommended");
+  hideAll("queue_explore_option");
 }
 
 
@@ -36,4 +41,4 @@ var hideFeeds = function() {
 }
 
 
-setTimeout(hideFeeds, 1000);
+setTimeout(hideFeeds, 100);