In the following I use this page for testing http://nitroflare.com/view/A71F0994E20F2E0/security-privacy.jpg
The below script clicks on Slow Download and removes the popup ad that shows up after the click.
Instead of clicking on Free Download, which will first popup a window, I want to call its second click function which is
function () {
$(this).hide();
$("#CountDownTimerContainer").show();
startFreeDownload();
}
My script executes $("#CountDownTimerContainer").show()
but it doesn't execute startFreeDownload()
for some reason.
Question
How can I call startFreeDownload()
which is on the page?
// ==UserScript==
// @name NitroFlare
// @namespace https://nitroflare.com/
// @description https://nitroflare.com/
// @include https://nitroflare.com/*
// @version 1
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @require https://greasyfork.org/scripts/5392-waitforkeyelements/code/WaitForKeyElements.js?version=115012
// ==/UserScript==
function SkipId(objId){
var oId = document.getElementById(objId);
oId.click();
}
window.onload = function(){
SkipId('slow-download');
};
waitForKeyElements("div.superbox-wrapper", removeSuperbox);
function removeSuperbox() {
document.getElementById('superbox-wrapper').hide();
}
$("#CountDownTimerContainer").show();
startFreeDownload();