Skip to content

Instantly share code, notes, and snippets.

@xim
Last active January 1, 2018 19:06
Show Gist options
  • Select an option

  • Save xim/ca63b8f8053517fc460b0b67508ed125 to your computer and use it in GitHub Desktop.

Select an option

Save xim/ca63b8f8053517fc460b0b67508ed125 to your computer and use it in GitHub Desktop.

Revisions

  1. xim revised this gist Jan 1, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion facebook-sponsored-content-remover.user.js
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@ function removeAds() {
    if (el && el != document) {
    el.remove();
    } else {
    i++
    i++;
    }
    }
    setTimeout(removeAds, 3000);
  2. xim revised this gist Jan 1, 2018. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions facebook-sponsored-content-remover.user.js
    Original file line number Diff line number Diff line change
    @@ -3,18 +3,18 @@
    // @namespace https://gist.github.com/xim
    // @description Removes all sponsored content.
    // @include https://www.facebook.com/*
    // @version 5
    // @version 6
    // @downloadURL https://gist.github.com/xim/ca63b8f8053517fc460b0b67508ed125/raw/facebook-sponsored-content-remover.user.js
    // @grant none
    // ==/UserScript==

    function removeAds() {
    var ads = document.getElementsByClassName('uiStreamAdditionalLogging');
    var ads = document.getElementsByClassName('g_xpd3mprlw');
    var i = 0;
    while (i < ads.length) {
    var el = ads[i];
    console.log(i);
    while (el && el != document && !el.attributes['data-testid']) {
    while (el && el != document && !el.id.startsWith('substream')) {
    el = el.parentNode;
    }
    if (el && el != document) {
  3. xim revised this gist May 10, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions facebook-sponsored-content-remover.user.js
    Original file line number Diff line number Diff line change
    @@ -3,8 +3,8 @@
    // @namespace https://gist.github.com/xim
    // @description Removes all sponsored content.
    // @include https://www.facebook.com/*
    // @version 4
    // @downloadURL https://gist.github.com/xim/ca63b8f8053517fc460b0b67508ed125/raw/fbwidth.user.js
    // @version 5
    // @downloadURL https://gist.github.com/xim/ca63b8f8053517fc460b0b67508ed125/raw/facebook-sponsored-content-remover.user.js
    // @grant none
    // ==/UserScript==

  4. xim revised this gist May 10, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion facebook-sponsored-content-remover.user.js
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,8 @@
    // @namespace https://gist.github.com/xim
    // @description Removes all sponsored content.
    // @include https://www.facebook.com/*
    // @version 3
    // @version 4
    // @downloadURL https://gist.github.com/xim/ca63b8f8053517fc460b0b67508ed125/raw/fbwidth.user.js
    // @grant none
    // ==/UserScript==

  5. xim revised this gist Dec 28, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions facebook-sponsored-content-remover.user.js
    Original file line number Diff line number Diff line change
    @@ -3,12 +3,12 @@
    // @namespace https://gist.github.com/xim
    // @description Removes all sponsored content.
    // @include https://www.facebook.com/*
    // @version 2
    // @version 3
    // @grant none
    // ==/UserScript==

    function removeAds() {
    var ads = document.getElementsByClassName('uiStreamSponsoredLink');
    var ads = document.getElementsByClassName('uiStreamAdditionalLogging');
    var i = 0;
    while (i < ads.length) {
    var el = ads[i];
  6. xim revised this gist Oct 1, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion facebook-sponsored-content-remover.user.js
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    // @namespace https://gist.github.com/xim
    // @description Removes all sponsored content.
    // @include https://www.facebook.com/*
    // @version 1
    // @version 2
    // @grant none
    // ==/UserScript==

  7. xim revised this gist Oct 1, 2016. 1 changed file with 10 additions and 5 deletions.
    15 changes: 10 additions & 5 deletions facebook-sponsored-content-remover.user.js
    Original file line number Diff line number Diff line change
    @@ -8,14 +8,19 @@
    // ==/UserScript==

    function removeAds() {
    var ads = document.getElementsByClass('uiStreamSponsoredLink');
    for (var i = 0; i != ads.length; i++) {
    var el = ads[0];
    while (el && !el.attributes['data-testid']) {
    var ads = document.getElementsByClassName('uiStreamSponsoredLink');
    var i = 0;
    while (i < ads.length) {
    var el = ads[i];
    console.log(i);
    while (el && el != document && !el.attributes['data-testid']) {
    el = el.parentNode;
    }
    if (el)
    if (el && el != document) {
    el.remove();
    } else {
    i++
    }
    }
    setTimeout(removeAds, 3000);
    }
  8. xim renamed this gist Oct 1, 2016. 1 changed file with 0 additions and 0 deletions.
  9. xim created this gist Oct 1, 2016.
    22 changes: 22 additions & 0 deletions facebook-sponsored-content-remover.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    // ==UserScript==
    // @name Facebook remove all sponsored content
    // @namespace https://gist.github.com/xim
    // @description Removes all sponsored content.
    // @include https://www.facebook.com/*
    // @version 1
    // @grant none
    // ==/UserScript==

    function removeAds() {
    var ads = document.getElementsByClass('uiStreamSponsoredLink');
    for (var i = 0; i != ads.length; i++) {
    var el = ads[0];
    while (el && !el.attributes['data-testid']) {
    el = el.parentNode;
    }
    if (el)
    el.remove();
    }
    setTimeout(removeAds, 3000);
    }
    removeAds();