GM_xmlhttpRequest works on some sites not on others

21 views
Skip to first unread message

BillTheTailor

unread,
May 17, 2012, 5:19:46 PM5/17/12
to greasemonkey-users
Subject pretty much says it all. I've got a script I'd like to use to
filling out shipping information on the USPS website. The script I'm
testing with is pretty simple:

<code>
// ==UserScript==
// @name Fill out shipping form based on Seamlyne order
// @namespace http://www.seamlyne.com
// @description Fill out USPS shipping form
// @include http://www.w3schools.com/xml/xml_parser.asp
// @include https://cns.usps.com/go/Secure/*
// @include http://serverAtWork/index.asp
// @version 1.0.006
// ==/UserScript==

function mainContent(){
console.log("world");
GM_xmlhttpRequest({
method: "GET",
url: "https://www.MyDomain.com/catalog/shippinglabel.asp?
idorder=1106",
onload: function(response) {
alert(response.responseText);
}
});

}

console.log("hello");

mainContent();
</code>

The script operates the way I'd expect it to on serverAtWork (I get
the text of the order header), and NOT on the other two servers, USPS
and w3schools. On the other two servers, GM_xmlhttpRequest doesn't
appear to work at all.

What gives?

- Bill in KC

BillTheTailor

unread,
May 17, 2012, 5:22:23 PM5/17/12
to greasemonkey-users
For clarification: this script was copied verbatim from another script
that DOES work, with the non-relevant bits stripped out. And, to
reiterate, it works fine on one server, but not another.
Reply all
Reply to author
Forward
0 new messages