我的GM_xmlhttpReqeustGreasemonkey 脚本中有如下功能设置(简化版)。
GM_xmlhttpRequest({
synchronous: false,
method: "HEAD",
url: "http://www.example1.com",
onload: function(response){console.debug(url);},
});
GM_xmlhttpReqeust在我的代码中以异步模式调用。访问后,
http://www.example1.com是否302 重定向到http://www.example2.com我想在回调函数中访问原始
url参数 (http://www.example1.com)的值。onload根据
GM_xmlhttpReqeust文档,http://www.example2.com可以在response.finalUrl内部onload回调中找到。
有人可以指点我正确的 Greasemonkey/JavaScript 方式吗?
