I’ve got a Greasemonkey script (written by another coder – Brock Adams) that loads sequentially the pages contained in the array at the beginning of the code.
How to open a list of pages automatically and sequentially?
// ==UserScript==
// @name Multipage, MultiSite slideshow of sorts
// @include http://google.com/*
// @include http://site2/*
// @include http://site3/*
// @include http://site4/*
// @grant GM_addStyle
// ==/UserScript==
/*- The @grant directive is needed to work around a major design
change introduced in GM 1.0.
It restores the sandbox.
*/
var urlsToLoad = [
'http://google.com/'
, 'http://site2/somepage/'
, 'http://site3/somepage/'
, 'http://site4/somepage/'
];
/*--- Since many of these sites load large pictures, Chrome's and
Firefox's injection may fire a good deal before the image(s)
finish loading.
So, insure script fires after load:
*/
window.addEventListener ("load", FireTimer, false);
if (document.readyState == "complete") {
FireTimer ();
}
//--- Catch new pages loaded by WELL BEHAVED ajax.
window.addEventListener ("hashchange", FireTimer, false);
function FireTimer () {
setTimeout (GotoNextURL, 5000); // 5000 == 5 seconds
}
function GotoNextURL () {
var numUrls = urlsToLoad.length;
var urlIdx = urlsToLoad.indexOf (location.href);
urlIdx++;
if (urlIdx >= numUrls)
urlIdx = 0;
location.href = urlsToLoad[urlIdx];
}
The problem comes when I have 2 pages of the same website to be loaded sequentially: the script stops working because the website uses AJAX in order to have a faster loading of its pages.
How can I force this script to fully reload pages?
As you can see he already tried:
//--- Catch new pages loaded by WELL BEHAVED ajax.
window.addEventListener ("hashchange", FireTimer, false);
to solve this issue, but it doesn’t work as expected.
In particular the site that gives me this issue is ink361.com.
I’ve created a jsFiddle of an example of his source: http://jsfiddle.net/XjjfK/
Thanks in advance.
I can’t login, but the script worked perfectly for me.
I installed the script exactly as below, and it cycled between those 3 ink361.com pages, just as expected.
Some things for you to do/check:
Are you using your other script (or ANY other GM script) on the same pages?
When you are browsing ink361.com, what does the Greasemonkey menu show?


It sounds like the installed script doesn’t have the
hashchangecode — which should work on that site, since it does update the hashtags.Post the exact, unedited script – that you are using – at pastebin.com, and link to it here.
Uninstall any other script for ink361.com, and install just the script below.
Does it work?
If not, post the console log, or Firebug’s log, at pastebin.com.