Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow timeout option for GM_xmlhttpRequest.

Fixes #1561
  • Loading branch information...
commit b4ecc6ff731ec9e38402fb46a3c7343908896828 1 parent 49b0ef5
@arantius arantius authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 content/xmlhttprequester.js
View
4 content/xmlhttprequester.js
@@ -66,6 +66,7 @@ function(safeUrl, details, req) {
setupRequestEvent(req, "load", details);
setupRequestEvent(req, "progress", details);
setupRequestEvent(req, "readystatechange", details);
+ setupRequestEvent(req, "timeout", details);
if (details.upload) {
setupRequestEvent(req.upload, "abort", details.upload);
setupRequestEvent(req.upload, "error", details.upload);
@@ -81,6 +82,9 @@ function(safeUrl, details, req) {
if (details.overrideMimeType) {
req.overrideMimeType(details.overrideMimeType);
}
+ if (details.timeout) {
+ req.timeout = details.timeout;
+ }
if (details.headers) {
var headers = details.headers;
Please sign in to comment.
Something went wrong with that request. Please try again.