I am trying to figure out how to refresh the page after the dom loads. If the dom loads and there is not a specific text on the page, it refreshes and keeps looping till that text is found.
// ==UserScript==
// @name My Fancy New Userscript
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description enter something useful
// @match http://stackoverflow.com/questions/8192126/clicking-a-button-on-a-page-using-a-greasemonkey-userscript-in-chrome/8192413#8192413
// @copyright 2012+, You
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js
// ==/UserScript==
function available() {
var nodeList = document.querySelectorAll('.table');
if (nodeList[0].innerHTML.indexOf( "Not available." ) != -1) {
Location.reload();
else {
alert("Hello! I am an alert box!!");
}
}
}
$(function() {
available();
});