AdBlock Rules For A Speedy YouTube

FASTER YOUTUBE!

Not just ad hiding,
this will also block connections,
and will prevent statistics collecting :]

the overall result is a huge performance-boost.

##.logo.doodle, .ytp-title-channel-logo, [class*="promo"], [class*="related-channel"], [class*="ytp-ad"], [id*="-ads"], [id*="ad_"], [id*="announcements-container"], [id^="feed-main"] > ol:nth-of-type(1) > li:nth-of-type(1), [id^="header"] > [id^="video-masthead"], [id^="watch-action-panels"]
##[__COMMENT^="-- All Ad - HREF ---"], [href*="/ads"], [href*="aditize.com"], [href*="adurl"], [href*="advert"], [href*="advertisements.com"], [href*="revcontent.com"], [href*="rotator.offpageads.com"], [href*="wpbblogad"], a[href$="#advertising"]
##[__COMMENT^="-- All Ad ---"], [class*="-ad-"]:not([class*="ytp-video"]), [class*="-adv"], [class*="-banner-ad-"], [class*="ad_icon_popout"], [class*="ad_section"], [class*="ad_text"], [class*="ad_wrapper"], [class*="ad-bottom-"], [class*="ad-link"], [class*="ad-slot"], [class*="ad-unit"], [class*="ad-wrap"], [class*="adbanner"], [class*="adContainer"], [class*="aditize"], [class*="admpu"], [class*="adroll"], [class*="adRoll"], [class*="adrotate"], [class*="ads-ad"], [class*="ads-visurl"], [class*="adsky"], [class*="adslot"], [class*="adv-"], [class*="advertisement-"], [class*="adVideo"], [class*="afs_ads"], [class*="azmodal"], [class*="banner__"], [class*="banner"][class*="ad"], [class*="BannerBox"], [class*="cc_banner-wrapper"], [class*="cc_banner"], [class*="dvertisment"], [class*="essb-mobile"], [class*="imagead"], [class*="inner_ad"], [class*="js-dfp-ad"], [class*="overlay-ad"], [class*="removeAd"], [class*="sponsorBottom"], [class*="SponsoredAds"], [class*="supportAds"], [class*="topAds"], [class*="topbar-ad"], [class^="ad-container"], [class^="ad-panel"], [class^="AdUnit"], [class^="singlead"][class$="container"], [class$="-adv"], [data-ad-client], [data-ad-slot], [data-entrycode*="RemAds"], [data-target*="adkex"], [href*="tkjs.us/"], [id*="-ad-"], [id*="-adv"], [id*="adrotate"], [id*="ads.spot"], [id*="adsens"], [id*="AdTarget"], [id*="advertisement"], [id*="azbounce"], [id*="b-teaser"], [id*="B-TEASER"], [id*="div-gpt-ad-"], [id*="searchAdv"], [id*="topad"], [id*="vPromo"], [id*="vspopup"], [id^="ad_"], [id^="ad_inters"], [id^="ad-link"], [id^="ad-unit"], [id^="AdBar"], [id^="AdFragment"], [id^="aditize"], [id$="adunit"], div.banner[onclick*="unc"], div.wpcnt div.wpa, div[class$="footer-ad"], section[id*="-ad-sec1"]
##[__COMMENT^="-- All Social/Share ---"], [class*="-share-button"], [class*="addthis"], [class*="bluebox"][class*="social"], [class*="entry-share"], [class*="gigyashare"], [class*="nav-social"], [class*="PopupSharing"], [class*="sd-shar"], [class*="sd-sharing-"], [class*="sd-sharing"], [class*="sd-social"], [class*="share42"], [class*="share-button"], [class*="share-container"], [class*="share-module"], [class*="share-post"], [class*="shareaholic"], [class*="sharebar"], [class*="sharedaddy"], [class*="sharing-button-list"], [class*="shr_canvas5"], [class*="social_shares"], [class*="social-container"]:not([class^="js-"]), [class*="social-icons"], [class*="social-share"], [class*="social-shares"], [class*="socialButtons"], [class*="socialheading"], [class*="socialicons"], [class*="socialite-widget"], [class*="socialmedia"], [class*="socials-container"], [class*="socials"], [class*="synved-social"], [class*="td-social-sharing"], [class*="td-tags-and-social"], [class*="ultimatesocialdeux"], [class*="us_share_buttons"], [class^="et_social"], [class^="ks-share"], [data-component*="sharebar"], [data-sharebar-options], [href*="com/sharer.php"], [href*="shareasale"], [id*="addthis"], [id*="horizontalsocial"], [id*="PopupSharing"], [id*="shareaholic"], [id*="shr_canvas5"], [id*="social_shares"], [id*="synved-social"], [id*="zsocial"], [onclick*="com/sharer.php"], [onclick*="facebook.com/sharer.php"], [src*="shareasale"], div.social-buttons, div.socialicons, div[class^="share"]
/csi
/generate_204
/img/favicon*$domain=youtube.com
/log
/mac_204
/pagead
/pixel
||googleads.g.doubleclick.net^
||pagead2.googlesyndication.com^
||pubads.g.doubleclick.net^
||s.youtube.com^
||static.doubleclick.net^
||www.googleadservices.com^
||www.googletagservices.com^
google.com/js/bg/
google.com/uds
googleapis.com/youtube/v3/videos?id*statistics*viewcount$xmlhttprequest,domain=youtube.com
no-remote-fonts: * true
youtube.com$important,other
youtube.com*adunit
youtube.com/*/log_interaction
youtube.com/api/stats
youtube.com/pagead
youtube.com/ptracking

Ps.
Please use uBlock Origin,
and remove ALL other AdBlock extension!!!

Block Sockets? Ask Me How!

This Little Chrome Extension: https://github.com/eladkarako/Chrome-Extension-Socket-Killer
Acts As A Socket-Firewall, Blocking WebSocket Connections, Even Before Connecting!
As A Bonus, It Also Null’ifies The WebSocket Object-Constructor :]

Blocking websockets, prevents the next-gen. ads from infiltrating your- presumingly ads-protected, browser.

It will also improve your Ad-Blocking extensions, catching most ads, blocking more connections, etc..

Enjoy.

AdBlock Rule To Block Ping And Beacon Requests

*$important,beacon

Compatible with every adblocking plugins, that supports the adblock-rule format.

You probably want to uninstall AdBlock and install uBlock Origin. AdBlock had sold out :/

The Most Popular Adblock Lists

Adblock Warning Removal List                   https://easylist-downloads.adblockplus.org/antiadblockfilters.txt
Anti-Adblock Killer by Reek                    https://raw.githubusercontent.com/reek/anti-adblock-killer/master/anti-adblock-killer-filters.txt
Blockzilla by zpacman                          https://raw.githubusercontent.com/zpacman/Blockzilla/master/Blockzilla.txt
EasyList                                       https://easylist.to/easylist/easylist.txt
EasyList Arabian                               https://easylist-downloads.adblockplus.org/Liste_AR.txt
EasyList Bulgarian                             http://stanev.org/abp/adblock_bg.txt
EasyList Chinese                               https://easylist-downloads.adblockplus.org/easylistchina.txt
EasyList Chinese CJX's Annoyance List          https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjx-annoyance.txt
Easylist Czech/Slovak                          https://raw.githubusercontent.com/tomasko126/easylistczechandslovak/master/filters.txt
EasyList Dutch                                 https://easylist-downloads.adblockplus.org/easylistdutch.txt
EasyList French                                https://easylist-downloads.adblockplus.org/liste_fr.txt
EasyList Germany                               https://easylist.to/easylistgermany/easylistgermany.txt
EasyList Hebrew                                https://raw.githubusercontent.com/easylist/EasyListHebrew/master/EasyListHebrew.txt
EasyList Icelandic                             https://adblock.gardar.net/is.abp.txt
EasyList Indonesian                            https://raw.githubusercontent.com/heradhis/indonesianadblockrules/master/subscriptions/abpindo.txt
EasyList Italian                               https://easylist-downloads.adblockplus.org/easylistitaly.txt
EasyList Japanese                              https://raw.githubusercontent.com/k2jp/abp-japanese-filters/master/abp_jp.txt
Easylist Latvian                               https://notabug.org/latvian-list/adblock-latvian/raw/master/lists/latvian-list.txt
EasyList Lithuanian                            http://margevicius.lt/easylistlithuania.txt
EasyList Romanian                              https://www.zoso.ro/pages/rolist.txt
EasyList Russian                               https://easylist-downloads.adblockplus.org/advblock.txt
EasyList Spanish                               https://easylist-downloads.adblockplus.org/easylistspanish.txt
EasyList without element hiding rules          https://easylist-downloads.adblockplus.org/easylist_noelemhide.txt
EasyPrivacy                                    https://easylist.to/easylist/easyprivacy.txt
EasyPrivacy without international filters      https://easylist-downloads.adblockplus.org/easyprivacy_nointernational.txt
Fanboy's Annoyance List                        https://easylist.to/easylist/fanboy-annoyance.txt
Fanboy's Social Blocking List                  https://easylist.to/easylist/fanboy-social.txt
I don't care about cookies                     https://www.kiboke-studio.hr/i-dont-care-about-cookies/abp/
Prebake - Filter Obtrusive Cookie Notices      https://raw.githubusercontent.com/liamja/Prebake/master/obtrusive.txt

You Can’t Really AdBlock Google-Analytics On Chrome

On Chrome/Chromium-based browsers,
Blocked Google-Analytics requests will be answered with an embedded-(BASE64)-content.

icompile.eladkarako.com_you_cant_really_adblock_google-analytics_on_chrome_response_headers

The BASE64 content:

KGZ1bmN0aW9uKCkgewoJLy8gaHR0cHM6Ly9kZXZlbG9wZXJzLmdvb2dsZS5jb20vYW5hbHl0aWNzL2Rldmd1aWRlcy9jb2xsZWN0aW9uL2FuYWx5dGljc2pzLwoJdmFyIG5vb3BmbiA9IGZ1bmN0aW9uKCkgewoJCTsKCX07Cgl2YXIgbm9vcG51bGxmbiA9IGZ1bmN0aW9uKCkgewoJCXJldHVybiBudWxsOwoJfTsKCS8vCgl2YXIgVHJhY2tlciA9IGZ1bmN0aW9uKCkgewoJCTsKCX07Cgl2YXIgcCA9IFRyYWNrZXIucHJvdG90eXBlOwoJcC5nZXQgPSBub29wZm47CglwLnNldCA9IG5vb3BmbjsKCXAuc2VuZCA9IG5vb3BmbjsKCS8vCgl2YXIgZ2FOYW1lID0gd2luZG93Lkdvb2dsZUFuYWx5dGljc09iamVjdCB8fCAnZ2EnOwoJdmFyIGdhID0gZnVuY3Rpb24oKSB7CgkJdmFyIGxlbiA9IGFyZ3VtZW50cy5sZW5ndGg7CgkJaWYgKCBsZW4gPT09IDAgKSB7CgkJCXJldHVybjsKCQl9CgkJdmFyIGYgPSBhcmd1bWVudHNbbGVuLTFdOwoJCWlmICggdHlwZW9mIGYgIT09ICdvYmplY3QnIHx8IGYgPT09IG51bGwgfHwgdHlwZW9mIGYuaGl0Q2FsbGJhY2sgIT09ICdmdW5jdGlvbicgKSB7CgkJCXJldHVybjsKCQl9CgkJdHJ5IHsKCQkJZi5oaXRDYWxsYmFjaygpOwoJCX0gY2F0Y2ggKGV4KSB7CgkJfQoJfTsKCWdhLmNyZWF0ZSA9IGZ1bmN0aW9uKCkgewoJCXJldHVybiBuZXcgVHJhY2tlcigpOwoJfTsKCWdhLmdldEJ5TmFtZSA9IG5vb3BudWxsZm47CglnYS5nZXRBbGwgPSBmdW5jdGlvbigpIHsKCQlyZXR1cm4gW107Cgl9OwoJZ2EucmVtb3ZlID0gbm9vcGZuOwoJd2luZG93W2dhTmFtZV0gPSBnYTsKfSkoKTs=

Is:

(function() {
	// https://developers.google.com/analytics/devguides/collection/analyticsjs/
	var noopfn = function() {
		;
	};
	var noopnullfn = function() {
		return null;
	};
	//
	var Tracker = function() {
		;
	};
	var p = Tracker.prototype;
	p.get = noopfn;
	p.set = noopfn;
	p.send = noopfn;
	//
	var gaName = window.GoogleAnalyticsObject || 'ga';
	var ga = function() {
		var len = arguments.length;
		if ( len === 0 ) {
			return;
		}
		var f = arguments[len-1];
		if ( typeof f !== 'object' || f === null || typeof f.hitCallback !== 'function' ) {
			return;
		}
		try {
			f.hitCallback();
		} catch (ex) {
		}
	};
	ga.create = function() {
		return new Tracker();
	};
	ga.getByName = noopnullfn;
	ga.getAll = function() {
		return [];
	};
	ga.remove = noopfn;
	window[gaName] = ga;
})();

Like it? Hate it?

It does not matter. It is there!

AdBlock Rules – Hide-Rules Addition

I maintain host.eladkarako.com which is a huge list of bad hostnames,
’till now there are the main adblock list with “block rule” such as:
||friendlyadvertisements.com^

BUT – I’ve figured I should probably also maintain hiding rules for each hostname,
it is relatively easy, and would benefit users which are getting visual elements such as links and such
which will still redirect the those bad domain, a, iframes, forms are the most targeted, while iframes would be blocked, and display an error message,
hiding rules, will also make them display:none which will help clean up the pages, even more :)

including href, src, onmousedown, onclick elements will help to benefit users keep their browser safe (less clickjacking!)

I’ve made a post in icompile.eladkarako.com instead of just adding another AdBlock list because
I wish this decision will get some more buzz through Google (the analytics shows this website gets 20,000 views a day so, in purely statistical manner someone would probably find this idea useful :) )

hiding rules looks like this

##[href*="friendlyadvertisements.com"]
##[src*="friendlyadvertisements.com"]
##[onmousedown*="friendlyadvertisements.com"]
##[onmouseup*="friendlyadvertisements.com"]
##[ontouchstart*="friendlyadvertisements.com"]
##[onclick*="friendlyadvertisements.com"]

while a-tags may sometimes wrap elements or even be styles themselves into a button (*ahammm* bad practice)
most of UI-frameworks usually uses mouse/touch related events quickly switching the href or opening window with the following “bad” hostname,
by hiding it – no clickjacking!

spread the idea,
if you are the owner of hosts list – get yourself an AdBlock list right away!
use my example at github.com/eladkarako/hosts.eladkarako.com!

Reverse Engineer And Modify D-Link Binary Firmware File

Some time ago I’ve published an article(post?) about blocking ads using the router,
while it works just fine for non-html files, such as scripts, images and such,
it isn’t so great solution for blocking iframes that shows HTML content,
why?

well..
when the (original firmware) D-Link router software identify a forbidden domain,
it sends out a series of responses, ending with a html page (HTML 1.0 302 redirect -> 200 response page),

while for <script> elements it works perfectly, since it renders an invalid script,
– blocked domain, which shows ads, for example in an iframe in the page (such as eBay),
will still block the original content, but will show an iframe, well… filled with the D-Link’s blocked page msg:

icompile.eladkarako.com_reverse_engineer_dlink_dir655_router_firmware_ads_page_2016-01-20_175855
Continue reading

AdBlock Advanced Selectors

Advanced selectors. Like A BOSS! 👔

💁 which are also applied to JavaScript‘s element.querySelector('....') and element.querySelectorAll('....'), and, naturally CSS3.

  • img[src^="https://example.com/ad"] (☞ “start with” match)

    will hide every image that starts with that string, (ad, ads, adware, ad_hello.. – included)

  • *[class*="ads-"] (☞ this is “middle match” or “everything match”)

    class attribute is a long space-separated string ⚋⚋, this will hide elements, which are having anything (partial match, but case-sensitive!) looking like this, it will hide:

    • <div class="toobar-ads-top foo">....</div>
    • <span class="vendorads-2 hello">....</span>
    • but also stuff like <div class="no-ads-at-all">...</div> ;)
  • a[href$="/bad_page.html"] (☞ “match end”)

    can help you hide links that are ending with this string, the long string can be something like this: https://example.com/pages/other_stuff/bad_page.html, and also http://cdn.example.com/just_another/bad_page.html.

see https://adblockplus.org/filter-cheatsheet and https://adblockplus.org/en/filters#elemhide_css

first test you use a correct syntax, open the developer-console and try to use document.querySelectorAll('img[src*="your_image.src"]') (or another selector of your choice that actually matches anything in your page

if this gets you an answer:
(full size)

You can go ahead and change it (slightly) to the AdBlock format which uses () instead of [],

meaning something like this #(id^="ads-container-")
or ||www.example.com#(class*="ads-")^

✨Enjoy Ads Free Browsing ✨ 😉

also answered in stackoverflow.