Skip to content

Instantly share code, notes, and snippets.

@DungGramer
Last active November 7, 2023 18:24
Show Gist options
  • Save DungGramer/08b68f0cac10d7ab75ead96dd1c17fb1 to your computer and use it in GitHub Desktop.
Save DungGramer/08b68f0cac10d7ab75ead96dd1c17fb1 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Instant setInterval Execution
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *://*/*
// @grant none
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
const originalSetInterval = window.setInterval;
window.setInterval = function (callback, delay, ...args) {
console.log('------interval callback--------');
console.dir(callback);
// Return a dummy interval ID
return originalSetInterval(callback, 0, ...args);
};
const originalSetTimeout = window.setTimeout;
window.setTimeOut = function (callback, delay, ...args) {
console.log('------timeout callback--------')
console.dir(callback);
// Return a dummy interval ID
return originalSetTimeout(callback, 0, ...args);
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment