reek / anti-adblock-killer

Anti-Adblock Killer helps you keep your Ad-Blocker active, when you visit a website and it asks you to disable.
http://reek.github.io/anti-adblock-killer/
Other
6.02k stars 758 forks source link

qbasic.net #1778

Open iamgreaser opened 8 years ago

iamgreaser commented 8 years ago
  1. Link page contains anti-adblock: http://www.qbasic.net/en/qbasic-downloads/games/action-2.htm
  2. One screenshot: https://i.imgur.com/NwDQjkA.png
  3. Your browser: Firefox 47.0.1 (Void Linux repo)
  4. Your script manager: Greasemonkey
  5. Your adblocker: uBlock Origin
  6. Your filterlists: uBlock (all but experimental), EasyList, Peter Lowe's, Easy Privacy

There is an element with the id "adbchk", forced height of 10px, offsetHeight ends up at 8. A workaround is to change the ID of the element so that document.getElementById("adbchk") returns null - document.getElementById("adbchk").id="a"+Math.random() could work.

Here's the offending function:

function dload(dlID,fileID) {
  if(document.getElementById("adbchk") && document.getElementById("adbchk").offsetHeight <= 10)
  {
    success = NULL;
  }
  else
  {
    ga('send', 'event', 'Download', 'Submit', fileID);
    location.href='http://' + window.location.hostname + '/dl.php?id=' + dlID + '&file=' + fileID;
    success = true;
  }

  return success;
}
jspenguin2017 commented 8 years ago

Or we can replace dload() with a special version:

setReadOnly("dload", function (dlID, fileID) {
    ga('send', 'event', 'Download', 'Submit', fileID);
    location.href='http://' + window.location.hostname + '/dl.php?id=' + dlID + '&file=' + fileID;
    window.success = true;
    return success;
});

Note:

const setReadOnly = function (name, val) {
    Object.defineProperty(unsafeWindow, name, {
        value: val,
        writable: false
    });
};

Or we can remove that element. I prefer to replace dload() since removing / renaming the element is usually done when the page loads, and there can be a gap between buttons become click-able and page loads.

Also, the original function looks a little bit weird, the boolean expression doesn't feel right... I think he meant !document.getElementById("adbchk") || document.getElementById("adbchk").offsetHeight < 10

mapx- commented 8 years ago

add

qbasic.net#@#.adsbygoogle
reek commented 8 years ago

@X01X012013 @mapx- thanks for rules