From: Karim Hamidou Date: Fri, 29 Dec 2017 15:43:34 +0000 (+0100) Subject: Add support for Chrome and Firefox X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=cd6b16cabb89cc154ce7dae839f238ba62802d6e;p=infinity-pools.git Add support for Chrome and Firefox --- diff --git a/README.md b/README.md index 74a85aa..5941152 100644 --- 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 index 0000000..80dff45 --- /dev/null +++ b/manifest.json @@ -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"] + } + ] +} diff --git a/start.js b/start.js index 1e610a0..0b2d456 100644 --- 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);