Skip to content

Instantly share code, notes, and snippets.

@lexoyo
Last active November 29, 2016 09:17
Show Gist options
  • Save lexoyo/faa0676fe729538cad37e863f3620754 to your computer and use it in GitHub Desktop.
Save lexoyo/faa0676fe729538cad37e863f3620754 to your computer and use it in GitHub Desktop.
reload X times
// ==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