Skip to content

Instantly share code, notes, and snippets.

@sr3d
Created August 29, 2010 19:03
Show Gist options
  • Save sr3d/556573 to your computer and use it in GitHub Desktop.
Save sr3d/556573 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Paypal Sandbox autorefresh
// @description Automatically refresh paypal sandbox pages
// @include https://paypalmanager.sandbox.paypal.com/*
// @include https://developer.paypal.com/*
// @include https://sandbox.paypal.com/*
// @include https://www.sandbox.paypal.com/*
// @include http://developer.paypal.com/*
// @author Alex Le (http://marrily.com)
// ==/UserScript==
(function() {
var refreshPeriod = 1000 * 60 * 5; // every 5 minutes
var timer;
window.onblur = function() {
timer = setTimeout( function() {
location.reload(true);
}, refreshPeriod);
}
window.onfocus = function() {
clearTimerout(timer);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment