Skip to content

Instantly share code, notes, and snippets.

@yrps
Last active September 6, 2016 18:22
Show Gist options
  • Save yrps/3ff25127428ae0d4a83087656784ac14 to your computer and use it in GitHub Desktop.
Save yrps/3ff25127428ae0d4a83087656784ac14 to your computer and use it in GitHub Desktop.
greasemonkey: Stay logged in to the card account page
// ==UserScript==
// @name citidirect session extender
// @namespace https://github.com/ncoop
// @description Stay logged in to the card account page
// @homepageURL https://gist.github.com/ncoop/3ff25127428ae0d4a83087656784ac14
// @include https://home.cards.citidirect.com/CommercialCard/*
// @icon https://gist.github.com/ncoop/3ff25127428ae0d4a83087656784ac14/raw/9b072f92411cf2ef25d41dd75be340052162779c/svg-citi.png
// @version 0.1.0
// @grant none
// ==/UserScript==
(function() {
"use strict";
var intervalMinutes = 10;
var intvId = setInterval(function() {
var anchor = document.querySelector('.gwt-MainBtnRed a')
if (anchor) {
console.log(Date() + " Clicking anchor.");
anchor.click();
} else {
console log(Date() + " Anchor not found.");
}
}, intervalMinutes * 60 * 1000);
console.log("Session refresh ID: " + intvId);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment