From 3c16f8d9d150c3c7efd4170bb2848b8fd6ae4443 Mon Sep 17 00:00:00 2001 From: gorhill Date: Wed, 9 Mar 2016 13:24:20 -0500 Subject: [PATCH] this addresses https://twitter.com/DThibaut67/status/707624770653843456 --- assets/checksums.txt | 4 +-- assets/ublock/filters.txt | 3 ++ assets/ublock/resources.txt | 58 +++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 2 deletions(-) diff --git a/assets/checksums.txt b/assets/checksums.txt index f532eb7c2..7b6cd1f0b 100644 --- a/assets/checksums.txt +++ b/assets/checksums.txt @@ -1,11 +1,11 @@ 538211a2228745b51b615b1b245cf99e assets/ublock/unbreak.txt 62111a29f0a5cb361ba8dbae92054adb assets/ublock/redirect-resources.txt 94efb2d9c4bd436707c3923d64cb4f3b assets/ublock/privacy.txt -5ed5e030d8458b17741c8cfb8a9d3a53 assets/ublock/filters.txt +26d0b04dd34902aaea921adeb5cf81a3 assets/ublock/filters.txt 98088252cedafb8571cf61b91bea219e assets/ublock/badware.txt 5baa90e2da7cd6a73edff2010557ee57 assets/ublock/redirect.txt b65ec581214a0d24dad6522a60f827ab assets/ublock/experimental.txt -b49ff635595425bdb99e53bdf7222cd7 assets/ublock/resources.txt +03611602139851de40bdf6cf04dc01f8 assets/ublock/resources.txt 059e0bfbf22bd242dda7b07389fe09a2 assets/ublock/filter-lists.json 3605c73f21abca428c7eb69a8bc32dfe assets/thirdparties/easylist-downloads.adblockplus.org/easyprivacy.txt a91af77c47c302c0741c7445b0fada1a assets/thirdparties/easylist-downloads.adblockplus.org/easylist.txt diff --git a/assets/ublock/filters.txt b/assets/ublock/filters.txt index dd3e71975..1bd514c55 100644 --- a/assets/ublock/filters.txt +++ b/assets/ublock/filters.txt @@ -331,3 +331,6 @@ tweaktown.com###background_skin # https://github.com/gorhill/uBlock/issues/1449 # Computers seizing thanks to this moronic script ||twnmm.com/js/*/adobe_audience_manager$script + +# https://twitter.com/DThibaut67/status/707624770653843456 +||connectormwi.laterpay.net/*/app-de-de.js$script,domain=sport1.de diff --git a/assets/ublock/resources.txt b/assets/ublock/resources.txt index bac49ff91..3e708a98c 100644 --- a/assets/ublock/resources.txt +++ b/assets/ublock/resources.txt @@ -745,3 +745,61 @@ setTimeout-defuser application/javascript return 1; }; })(); + + +# Completely experimental: load Disqus on demand only. Purpose is to avoid +# connecting to Disqus' servers, unless the user explicitly asks for the +# comments to be loaded. +# Works with following filters: +# ||disqus.com/forums/*/embed.js$script,redirect=disqus.com/forums/*/embed.js +# ||disqus.com/embed.js$script,redirect=disqus.com/embed.js +# ||disqus.com/count.js$script +# @@||disqus.com/embed.js?_=1457540*$script +# If you want a site you regularly visit to always have the comment loaded, +# just use an exception static filter. Example for wired.com: +# @@||wired.disqus.com/embed.js + +# Sometimes a site will use this one script: +disqus.com/forums/*/embed.js application/javascript +(function() { + var ee = document.getElementsByTagName('script'); + var i = ee.length, src; + while ( i-- ) { + src = ee[i].src || ''; + if ( src === '' ) { + continue; + } + if ( src.lastIndexOf('disqus.com/embed.js') === (src.length - 19) ) { + return; + } + } + var e = document.createElement('script'); + e.async = true; + e.src = '//' + window.disqus_shortname + '.disqus.com/embed.js'; + document.body.appendChild(e); +})(); + +# Most use this one though: +disqus.com/embed.js application/javascript +(function() { + var p = document.getElementById(window.disqus_container_id || 'disqus_thread'); + if ( p === null ) { + return; + } + var b = document.createElement('button'); + b.textContent = 'Disqus blocked by uBlock Origin: click to unblock'; + b.type = 'button'; + p.appendChild(b); + var loadDisqus = function(ev) { + b.removeEventListener('click', loadDisqus); + p.removeChild(b); + var script = document.createElement('script'); + script.async = true; + var t = Date.now().toString(); + script.src = '//' + window.disqus_shortname + '.disqus.com/embed.js?_=1457540' + t.slice(-6); + document.body.appendChild(script); + ev.preventDefault(); + ev.stopPropagation(); + }; + b.addEventListener('click', loadDisqus); +})();