Open iamgreaser opened 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
add
qbasic.net#@#.adsbygoogle
@X01X012013 @mapx- thanks for rules
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: