javascript - How to execute function on page? -
in following use page testing http://nitroflare.com/view/a71f0994e20f2e0/security-privacy.jpg
the below script clicks on slow download , removes popup ad shows after click.
instead of clicking on free download, first popup window, want call second click function is
function () { $(this).hide(); $("#countdowntimercontainer").show(); startfreedownload(); }
my script executes $("#countdowntimercontainer").show()
doesn't execute startfreedownload()
reason.
question
how can call startfreedownload()
on 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();
document.getelementbyid
returns dom node, doesn't have hide()
method.
either use jquery manually: $('#superbox-wrapper').hide()
or use waitforkeyelements shown in example:
function removesuperbox(jnode) { jnode.hide(); }
also, since you're injecting own jquery page , use @grant none
may need use jquery.noconflict() if site has own jquery.
Comments
Post a Comment