// ==UserScript== // @name adshorte.shorte // @namespace http://adshorte/ // @include *://adshorte.com/* // @version 1.2 // @description adshorte.com用 // @grant none // @run-at document-end // @downloadURL none // ==/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) { } }); }