Last active
November 29, 2016 09:17
-
-
Save lexoyo/faa0676fe729538cad37e863f3620754 to your computer and use it in GitHub Desktop.
reload X times
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name reload X times | |
// @namespace secretmedia | |
// @include * | |
// @version 0.3 | |
// @description reload X times | |
// @author me lexoyo | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var NUM_RELOADS = 100; | |
// console.log('reload extension', NUM_RELOADS, window.name); | |
setTimeout(function() { | |
var num = parseInt(window.name); | |
if(isNaN(num)) num = 0; | |
if(num >= 0 && num < NUM_RELOADS) { | |
window.location.reload(); | |
window.name = (num || 0)+1; | |
} | |
else { | |
alert('reload extension end', NUM_RELOADS); | |
window.name = "0"; | |
} | |
}, 100); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment