{"action":"created","issue":{"url":"https://api.github.com/repos/reek/anti-adblock-killer/issues/1556","repository_url":"https://api.github.com/repos/reek/anti-adblock-killer","labels_url":"https://api.github.com/repos/reek/anti-adblock-killer/issues/1556/labels{/name}","comments_url":"https://api.github.com/repos/reek/anti-adblock-killer/issues/1556/comments","events_url":"https://api.github.com/repos/reek/anti-adblock-killer/issues/1556/events","html_url":"https://github.com/reek/anti-adblock-killer/issues/1556","id":158790935,"number":1556,"title":"Anti-bait as a second line of defense","user":{"login":"DeeSnow97","id":6754905,"avatar_url":"https://avatars.githubusercontent.com/u/6754905?v=3","gravatar_id":"","url":"https://api.github.com/users/DeeSnow97","html_url":"https://github.com/DeeSnow97","followers_url":"https://api.github.com/users/DeeSnow97/followers","following_url":"https://api.github.com/users/DeeSnow97/following{/other_user}","gists_url":"https://api.github.com/users/DeeSnow97/gists{/gist_id}","starred_url":"https://api.github.com/users/DeeSnow97/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DeeSnow97/subscriptions","organizations_url":"https://api.github.com/users/DeeSnow97/orgs","repos_url":"https://api.github.com/users/DeeSnow97/repos","events_url":"https://api.github.com/users/DeeSnow97/events{/privacy}","received_events_url":"https://api.github.com/users/DeeSnow97/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-06T22:33:25Z","updated_at":"2016-06-08T17:01:59Z","closed_at":null,"body":"I've experimented a little with F*ckAdBlock and BlockAdblock (the strong one), found some ways around them not using their variables, but rather interrupting their detection process and stopping the adblocker from taking the bait. It's not a full solution, but it was tested against and defeated both of the two above, regardless how the sites customize it. I'm giving a full userscript below, but by taking (and maybe extending) only the bait variable and the contents of the loop this can be integrated into your project. Just loop it fast enough to evade the bait before they could detect you. (If I knew how this works in your code, this would be a pull request.)\r\n\r\n```javascript\r\n// ==UserScript==\r\n// @name         BaitKiller\r\n// @version      0.1\r\n// @description  FuckFuckAdBlock\r\n// @author       Ben Snow\r\n// @include http://*/*\r\n// @include https://*/*\r\n// @grant unsafeWindow\r\n// @grant GM_addStyle\r\n// @grant GM_getValue\r\n// @grant GM_setValue\r\n// @grant GM_xmlhttpRequest\r\n// @grant GM_registerMenuCommand\r\n// @grant GM_deleteValue\r\n// @grant GM_listValues\r\n// @grant GM_getResourceText\r\n// @grant GM_getResourceURL\r\n// @grant GM_log\r\n// @grant GM_openInTab\r\n// @grant GM_setClipboard\r\n// @grant GM_info\r\n// @grant GM_getMetadata\r\n// @run-at document-start\r\n// ==/UserScript==\r\n\r\n(function() {\r\n    'use strict';\r\n\r\n    var bait = '.pub_300x250, .pub_300x250m, .pub_728x90, .text-ad, .textAd, .text_ad, .text_ads, .text-ads, .text-ad-links, #ad-left, #adBannerWrap, #ad-frame, #ad-header, #ad-img, #ad-inner, #ad-label, #ad-lb, #ad-footer, #ad-container, #ad-container-1, #ad-container-2, #Ad300x145, #Ad300x250, #Ad728x90, #AdArea, #AdFrame1, #AdFrame2, #AdFrame3, #AdFrame4, #AdLayer1, #AdLayer2, #Ads_google_01, #Ads_google_02, #Ads_google_03, #Ads_google_04, #DivAd, #DivAd1, #DivAd2, #DivAd3, #DivAdA, #DivAdB, #DivAdC, #AdImage, #AdDiv, #AdBox160, #AdContainer, #glinkswrapper, #adTeaser, #banner_ad, #adBanner, #adbanner, #adAd, #bannerad, #ad_box, #ad_channel, #adserver, #bannerid, #adslot, #popupad, #adsense, #google_ad, #outbrain-paid, #sponsored_link' ;\r\n\r\n    requestAnimationFrame( function killBait() {\r\n\r\n        // Evade F*ckAdBlock's bait and BlockAdblock's first line of defense\r\n        Array.prototype.slice.call( document.querySelectorAll( bait ) ).filter( function( element ) {\r\n            var style = window.getComputedStyle( element, null ) ;\r\n            return style.width == '1px' || style.height == '1px' || parseFloat( style.left ) <= -1000 || parseFloat( style.top ) <= -1000 ;\r\n        }).map( function( element ) {\r\n            element.setAttribute( 'style', element.style.cssText.split(';').filter( function( property ) {\r\n                return property && !~['display','visibility','opacity'].indexOf( property.split(':')[0].trim() ) ;\r\n            }).join(';') + '; display: initial !important; visibility: initial !important; opacity: 0.001 !important' ) ; // 0.001 is not 0, but it's below 0.004 which is the smallest visible amount\r\n        });\r\n\r\n        // Trigger a shortcut through BlockAdBlock's second line\r\n        Array.prototype.slice.call( document.querySelectorAll( '[src=\"pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\"]' ) ).map( function( element ) {\r\n            element.parentNode.removeChild( element ) ; // Don't worry, it already ran, we just don't want anyone to see it did\r\n        });\r\n        if( !document.querySelector( 'ins.adsbygoogle' ) ) {\r\n            var ins = document.createElement('ins') ;\r\n            ins.classList.add( 'adsbygoogle' ) ;\r\n            document.body.appendChild( ins ) ;\r\n        }\r\n\r\n        // Keep on looping\r\n        requestAnimationFrame( killBait ) ;\r\n    });\r\n})();\r\n```\r\n\r\nI borrowed a few lines from your initial comments to test it out. Also, [here](https://github.com/reek/anti-adblock-killer/files/301448/blockadblock-decrypted.txt) you can find a slightly deobfuscated and shamelessly commented version of BlockAdblock's default code (just rename it to JS because GitHub didn't let me upload it). A bit deeper in their code than the .bab() function they have a few countermeasures, some so strong that if they start using it, userscripts may not be enough, we would need a different kind of adblocker for that. Or a service worker, hopefully, that arrives fast enough.\r\n\r\nAlso, if you know any other anti-adblock technologies, I'd be glad to trick my way through them."},"comment":{"url":"https://api.github.com/repos/reek/anti-adblock-killer/issues/comments/224658307","html_url":"https://github.com/reek/anti-adblock-killer/issues/1556#issuecomment-224658307","issue_url":"https://api.github.com/repos/reek/anti-adblock-killer/issues/1556","id":224658307,"user":{"login":"DeeSnow97","id":6754905,"avatar_url":"https://avatars.githubusercontent.com/u/6754905?v=3","gravatar_id":"","url":"https://api.github.com/users/DeeSnow97","html_url":"https://github.com/DeeSnow97","followers_url":"https://api.github.com/users/DeeSnow97/followers","following_url":"https://api.github.com/users/DeeSnow97/following{/other_user}","gists_url":"https://api.github.com/users/DeeSnow97/gists{/gist_id}","starred_url":"https://api.github.com/users/DeeSnow97/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DeeSnow97/subscriptions","organizations_url":"https://api.github.com/users/DeeSnow97/orgs","repos_url":"https://api.github.com/users/DeeSnow97/repos","events_url":"https://api.github.com/users/DeeSnow97/events{/privacy}","received_events_url":"https://api.github.com/users/DeeSnow97/received_events","type":"User","site_admin":false},"created_at":"2016-06-08T17:01:59Z","updated_at":"2016-06-08T17:01:59Z","body":"That's strange, I never suggest untested code. In which conditions did it not work? Which adblocker did you test it with?\r\n\r\nAlso, this is not a replacement for your solution, but an additional layer of defense. For example, your fake F*ckAdBlock script works perfectly until the site starts renaming it, then you need to set it manually for each site. This solution, however, doesn't take out F*ckAdBlock by faking the library but instead tries to secure the bait and keep it intact, so even if F*ckAdBlock works, it will think the bait is unblocked. It's possible that my solution failed to defend the bait against your adblocker, that's why I'm interested in which one you used. I used Tampermonkey, uBlock, and Chrome 50.\r\n\r\nThe majority of the issues you linked have the tag \"Anti-Adblock\". Is that a specific plugin? Quite ironically all my search queries end up at your script (or at some random tutorials), so if it is a specific plugin, could you link the page where I could acquire it if I was a site admin who hated adblock and tried to block it?"}}
{"actor":{"display_login":"DeeSnow97"}}