The "easy way" won't (doesn't) work.

Firefox thinks the location.href is "about:blank" until the page is 
"loaded". ("accessed" and/or "timed out"?)
And that takes however long Firefox takes for a page to timeout.

Normally you get: (after some amount of time, usually at least several 
seconds)

The connection has timed out

The server at userscripts.org is taking too long to respond.

The GmScript is loaded for the page, and apparently executes, but nothing 
happens.
If I execute the code in a Javascript Shell window referenced to that page, 
it then redirects.
So I'm not sure what's happening, although it doesn't matter, because who 
wants to wait
several seconds for a page timeout.

Here is the GmScript:

// ==UserScript==
// @name        userscripts.org archiver redirect
// @namespace   http://www.whatever.tld/
// @description Redirect userscripts.org to Internet Archive Wayback Machine
// @include     http*://*userscripts.org*
// @version     1
// @grant       none
// ==/UserScript==

sHREF = location.href;

if (sHREF.substr (0, 23) == "http://userscripts.org/";  ||
      sHREF.substr (0, 24) == "https://userscripts.org/";  ||
      sHREF.substr (0, 27) == "http://www.userscripts.org/";  ||
      sHREF.substr (0, 28) == "https://www.userscripts.org/";) {
   location = "https://web.archive.org/web/"; + sHREF;
}

(why is there no "Code" formatting in the Google Groups editor?)

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/greasemonkey-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to