Disable ad-loading for faster page loads:
- ?ads=placeholder
Disable page reload so you don’t lose your console code
api.pageRefresh.clear()
Replace lowercase characters with the previous ascii character to make text unreadable
[].forEach.call(document.querySelectorAll('h1, h2, h3, p'), function(el){ el.textContent = el.textContent.replace(/([a-z])/g, function(m){ return String.fromCharCode(m.charCodeAt() - 1) } ) })
Replace all images with grey boxes
[].forEach.call(document.querySelectorAll('img'), function(img){ img.setAttribute('src', 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'); img.style.backgroundColor = '#aaa' });
Remove script-tags
[].forEach.call(document.querySelectorAll('script, noscript'), function(script){ script.parentNode.removeChild(script) })
Remove all child elements from body except .apiMultifix
[].forEach.call(document.querySelectorAll('body > *:not(.apiMultifix)'), function(el){ el.parentNode.removeChild(el) })
Remove meta-tags except viewport
[].forEach.call(document.querySelectorAll('meta[property], meta[name]:not([name=viewport])') function(el){ el.parentNode.removeChild(el) })
Remove script-tags, all child elements from body except .apiMultifix, meta-tags except viewport and response
[].forEach.call(document.querySelectorAll('body > *:not(.apiMultifix), script, noscript, meta[property], meta[name]:not([name=viewport]), .response, .apiRecommendOrTweet'), function(script){ script.parentNode.removeChild(script) })
Point all links to #
[].forEach.call(document.querySelectorAll('a'), function(a){ a.setAttribute('href', '#' )})
Make adreplacement less intrusive
First load the page with ads=placeholder
[].forEach.call(document.querySelectorAll('.apiAdPlaceHolder'), function(ad){ ad.style.backgroundColor = '#aaa'; ad.style.color = '#666'; while(ad.childNodes.length > 0) { ad.removeChild(ad.firstChild) }; ad.innerText = 'annonse' })
[].forEach.call(document.querySelectorAll('.apiPage img'), function(img){ img.setAttribute('src', 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'); img.style.backgroundColor = '#aaa' });