adshorte.com用
目前為
// ==UserScript==
// @name adshorte.shorte
// @namespace http://adshorte/
// @include *://adshorte.com/*
// @version 1.1
// @grant GM_xmlhttpRequest
// @description adshorte.com用
// @grant none
// @run-at document-end
// ==/UserScript==
(function() {
var iframes = document.getElementsByTagName('iframe');
for(var iframe of iframes){
if(iframe.src.indexOf("dailymotion") != -1){
iframe.parentNode.removeChild(iframe);
}
}
})();
function openSesame() {
if (grecaptcha.getResponse(0) !== "") {
document.getElementById("link-view").submit();
clearInterval(b);
}
}
var b = setInterval(openSesame, 500);
if (document.getElementById("go-link") !== null) {
var goForm = $("#go-link");
var submitButton = goForm.find('button');
$.ajax({
dataType: 'json',
type: 'POST',
url: goForm.attr('action'),
data: goForm.serialize(),
success: function(result, status, xhr) {
if (result.url) {
location.href = result.url;
} else {
alert(result.message);
}
},
error: function(xhr, status, error) {
console.log("An error occured: " + xhr.status + " " + xhr.statusText);
},
complete: function(xhr, status) {
}
});
}