项目作者: tiratatp

项目描述 :
An open-source Ad Blocker for Facebook™
高级语言: JavaScript
项目地址: git://github.com/tiratatp/facebook_adblock.git
创建时间: 2016-06-15T21:18:43Z
项目社区:https://github.com/tiratatp/facebook_adblock

开源协议:GNU General Public License v3.0

下载


facebook_adblock

An open-source Ad Blocker for Facebook™

This extension is 100% free and open source.

Installation

Chrome

https://chrome.google.com/webstore/detail/ad-blocker-for-facebook/kinpgphmiekapnpbmobneleaiemkefag

Chrome Web Store
Chrome Web Store
Chrome Web Store

Firefox

https://addons.mozilla.org/en-US/firefox/addon/fb_ad_block/ (Thanks to Chih-Hsuan Yen)

Mozilla Add-on
Mozilla Add-on
Mozilla Add-on

Enjoy!

We are not affiliated, associated, authorized, endorsed by, or in any way officially connected with Facebook.

Facebook is a registered trademark of the Facebook, Inc.

Building

  1. Run npm run release
  2. The compiled extension should be in dist/
  3. Load the unsigned extension into your browser

Debugging

All processed DOM elements are flagged with data-blocked attribute. Possible values are:

  • allowedList: allowed list
  • blockedList: blocked due to blocked list check
  • sponsored: blocked due to sponsored label

You can use dev tools console with CSS selectors like *[data-blocked] or *[data-blocked=sponsored].

For example add inline style properties to all existing hidden sponsored posts:

  1. document.querySelectorAll("*[data-blocked=sponsored]").forEach((x) => {
  2. x.style.display="inherit";
  3. x.style.border="red 10px solid";
  4. });

You can also inject css which applies to both existing and new processed elements:

  1. document.head.insertAdjacentHTML("beforeend",
  2. `<style>
  3. *[data-blocked] {
  4. display:inherit !important;
  5. border: red 10px solid;
  6. }
  7. *[data-blocked=allowedList] {
  8. border-color: green;
  9. }
  10. *[data-adblocked] {
  11. display:inherit !important;
  12. border: pink 10px solid;
  13. }
  14. *[data-adblock-monitored] {
  15. border: blue 10px solid;
  16. }
  17. *[data-adblock-observed] {
  18. border: aqua 10px solid;
  19. }
  20. </style>`);

Publishing

  1. Tag a commit with a string with this format v*.*.*
    • git tag -a v2.0.0
  2. Push a tag to Github
  3. Github action should publish the extension to both Firefox and Chrome
    • Firefox should be released in a couple of minutes
    • Chrome can take as long as a few months if it needs a review