开发者

Why doesn't greasemonkey make this GM_xmlhttpRequest?

According to http://wiki.greasespot.net/GM_xmlhttpRequest, somthing like this script should work:

// ==UserScript==
// @name           test
// @namespace      _test
// @include        http://stackoverflow.com/*
// ==/UserScript==

alert("_hello world_");

GM_xmlhttpRequest({
  method: "GET",
  url: "http://www.flickr.com/",
  onload: function(resp开发者_如何转开发onse) {
    alert("success");
  },
  onerror: function(response) {
      alert(
          [
            response.status,
            response.statusText,
          ].join("\n"));
  }
});

When I try it, I get the "hello world", but the GM_xmlhttpRequest seems to fail silently.

Why doesn't the onloador the onerror execute?

I use Firefox 4.0, Greasemonkey 0.9.1. (A combination that seems very prone to crash).


This is a bug, please report to http://github.com/greasemonkey/greasemonkey/issues


Might be an issue in upstream; opened a new tab and the issue disappeared. Please follow: https://github.com/greasemonkey/greasemonkey/issues/1318 and https://bugzilla.mozilla.org/show_bug.cgi?id=647727

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜