Last active
July 2, 2021 14:58
-
-
Save janglapuk/790470741a39a0f2301b27d234e6a9cc to your computer and use it in GitHub Desktop.
GreaseMonkey/TamperMonkey script for automating adf.ly 'Skip' button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name adf.ly Auto Skip Ad | |
| // @namespace http://github.com/janglapuk | |
| // @version 0.5 | |
| // @description Let you ignore the bunch of ads :] (simple and optimized rev) | |
| // @author janglapuk | |
| // @match http://adf.ly/* | |
| // @require http://code.jquery.com/jquery-3.2.1.slim.min.js | |
| // @require https://gist.githubusercontent.com/raw/2625891/waitForKeyElements.js | |
| // @updateURL https://gist.github.com/janglapuk/790470741a39a0f2301b27d234e6a9cc/raw/adfly-skipper.user.js | |
| // @grant none | |
| // ==/UserScript== | |
| // Credits: | |
| // BrockA for waitForKeyElements.js (https://gist.github.com/BrockA) | |
| (function() { | |
| 'use strict'; | |
| var skipBtn = 'a#skip_button[href]'; | |
| waitForKeyElements(skipBtn, function() { | |
| var aLink = $(skipBtn); | |
| window.location = aLink.attr('href'); | |
| }); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is my suggestion, hastely put together because I had to download a lot, but at this time (july 2021) it does the job without popups, clicks and speeded up 4 seconds wait time.
Only now I realise what a lot of clicks that normally is..
`// ==UserScript==
// @name adf.ly Auto Skip Ad
// @namespace http://github.com/janglapuk
// @Version 1.0
// @description Let you ignore the bunch of ads :] (simple and optimized rev)
// @author janglapuk (feat. LuukvdHoogen).
// @match http://adf.ly/*
// @include ://zeybui.
// @require http://code.jquery.com/jquery-3.2.1.slim.min.js
// @require https://gist.githubusercontent.com/raw/2625891/waitForKeyElements.js
// @updateURL https://gist.github.com/janglapuk/790470741a39a0f2301b27d234e6a9cc/raw/adfly-skipper.user.js
// @grant none
// ==/UserScript==
// Credits:$(".mwButton")) {$ ('a').unbind(); $('div').unbind(); $ ('a').removeEventListener('mousedown',specific_function); $(".mwButton").first().click(); };
// BrockA for waitForKeyElements.js (https://gist.github.com/BrockA)
'use strict';
var tellertje = 0;
if (typeof browser === "undefined") {
var browser = firefox;
}
browser.tabs.onCreated.addListener(callbacky);
function callbacky() {close(); console.log("POP!");};
$("iframe").each(function() {
$(this).remove();
});
var d=new Date();document.cookie='\x61\x64\u0066\u0070\x6f\x70\x61\x64\u003d' + d;
setInterval(function() {
var d=new Date();document.cookie='\x61\x64\u0066\u0070\x6f\x70\x61\x64\u003d' + d;
gaq.push(['_trackEvent', 'Ad', 'Paid', 'Success', 3]);
var clearAllTimeouts = (function () {
var noop = function () {},
firstId = window.setTimeout(noop, 0);
return function () {
var lastId = window.setTimeout(noop, 0);
$('iframe').hide();
if(
console.log('Removing', lastId - firstId, 'timeout handlers');
while (firstId != lastId)
{ window.clearTimeout(++firstId);}
if(tellertje == 10) {window.close();};
tellertje++;
};},500);
});
`