/* * Originally made by an anonymous netizen: https://adblockbar.neocities.org/ * Modified by yours truly: https://rayhammer.dev/ */ var AdBlockBar = function() { this.installed = true this.displayOnce = true this.appUrls = { "iPrison": "http://adblockios.com/", "adSkynet5000": "https://adblockplus.org/", "aRealComputer": "https://github.com/gorhill/uBlock" } this.localStorageId = '__adblockbar_shown' if(navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) this.platform = 'iPrison' else if(navigator.userAgent.match(/Android/i)) this.platform = 'adSkynet5000' else this.platform = 'aRealComputer' this.detect = function() { var bait = document.createElement('img') bait.onerror = function() { //this.parentNode.removeChild(this) } bait.id = '__adblockbar_bait' bait.style['position'] = 'absolute' bait.style['left'] = '-999em' bait.src = 'ad1.jpg' document.getElementsByTagName('body')[0].insertBefore(bait, document.getElementsByTagName('body')[0].firstChild) var self = this setTimeout(function() { if(!bait || bait.style.display != 'none') self.display() }, 200) } this.display = function() { if(this.displayOnce === true && localStorage.getItem(this.localStorageId) == 'true') return if(this.displayOnce === true) localStorage.setItem(this.localStorageId, 'true') var html = '
' var banner = document.createElement('div'); banner.innerHTML = html; this.banner = banner.firstChild var body = document.getElementsByTagName('body')[0] body.insertBefore(this.banner, body.firstChild) //this.adjustPageMargin() } } window.onload = function() { var adBlockBar = new AdBlockBar() adBlockBar.displayOnce = false adBlockBar.detect() }