Greasy Fork

Adfly-skipper

Automatically skip ad-fly

目前为 2017-10-30 提交的版本。查看 最新版本

// ==UserScript==
// @name         Adfly-skipper
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  Automatically skip ad-fly
// @author       giuseppe-dandrea
// @match        http*://q.gs/*
// @match        http*://j.gs/*
// @match        http*://adf.ly/*
// @match        http*://bc.vc/*
// @grant        none
// ==/UserScript==

var url = window.location.href;

if (url.indexOf("q.gs") != -1 || url.indexOf("j.gs") != -1 || url.indexOf("adf.ly") != -1 ) {
    adfly_bypass();
}
else if (url.indexOf("bc.vc") != -1 ) {
    bcvc_bypass();
}

function adfly_bypass() {
    var href = "";
    new Promise((resolve) => setTimeout(resolve, 1000)).then(() => {
		href = $('#skip_bu2tton')[0].href;
        if (href === "") {
            href = get_href();
        }
        else {
            window.open(href, '_self');
        }
	});
}

function bcvc_bypass() {
    new Promise((resolve) => setTimeout(resolve, 1000)).then(() => {
		if ($('#skip_btt').size() === 1) {
            $('#skip_btt').trigger('click');
        }
        else {
            bcvc_bypass();
        }
	});
}