如何绕过tampermonkey的简单倒计时?

时间:2017-05-11 00:46:41

标签: javascript greasemonkey tampermonkey

我有这个倒计时javascript:

<script type="text/javascript">
var seconds = 5;
var timer;
function countdown() {
    if(seconds >= 0) {
        document.getElementById('dl').innerHTML = seconds;
    } else {
        document.getElementById('show').innerHTML = '<a href="http://mylinkhere.link"><img src="/button.png"/></a>';
        clearInterval(timer);   
    }
    seconds--;
}
timer = setInterval(countdown, 1000);
</script>

如何为此特定网站创建一个在tampermonkey中运行的功能,以便减少甚至立即绕过它?

1 个答案:

答案 0 :(得分:0)

// ==UserScript==
// @name         Newscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @author       Username
// @match        http://mylinkhere.link/download/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    window.seconds = -1;
})();