Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
Update Facebook Adblocker
Browse files Browse the repository at this point in the history
  • Loading branch information
lelinhtinh committed Dec 24, 2020
1 parent e406370 commit fc13a03
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fb_adblock/fb_adblock.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// @namespace https://lelinhtinh.github.io
// @description Block all ads in Facebook News Feed.
// @description:vi Chặn quảng cáo được tài trợ trên trang chủ Facebook.
// @version 1.3.1
// @version 1.3.2
// @icon https://i.imgur.com/F8ai0jB.png
// @author lelinhtinh
// @oujs:author baivong
Expand All @@ -25,10 +25,9 @@
let observerLabel;
let observerStory;
let observerHead;
let isWatch;

const removeAd = (adsLabel) => {
const adsWrap = adsLabel.closest(isWatch ? 'div:not([class*=" "])' : '[data-pagelet^="FeedUnit"]');
const adsWrap = adsLabel.closest(location.pathname.startsWith('/watch') ? '._6x84' : '[data-pagelet^="FeedUnit"]');
// adsWrap.style.opacity = 0.1;
adsWrap.remove();
console.log(++adsCount, 'adsCount');
Expand Down Expand Up @@ -89,7 +88,6 @@
};

const init = () => {
isWatch = location.pathname === '/watch';
const newsFeed = document.querySelector('[role="feed"], [data-pagelet="MainFeed"]');
if (newsFeed === null) return;

Expand Down

0 comments on commit fc13a03

Please sign in to comment.