Skip to content
This repository
Browse code

Allow timeout option for GM_xmlhttpRequest.

Fixes #1561
  • Loading branch information...
commit b4ecc6ff731ec9e38402fb46a3c7343908896828 1 parent 49b0ef5
arantius authored June 15, 2012

Showing 1 changed file with 4 additions and 0 deletions. Show diff stats Hide diff stats

  1. 4  content/xmlhttprequester.js
4  content/xmlhttprequester.js
@@ -66,6 +66,7 @@ function(safeUrl, details, req) {
66 66
   setupRequestEvent(req, "load", details);
67 67
   setupRequestEvent(req, "progress", details);
68 68
   setupRequestEvent(req, "readystatechange", details);
  69
+  setupRequestEvent(req, "timeout", details);
69 70
   if (details.upload) {
70 71
     setupRequestEvent(req.upload, "abort", details.upload);
71 72
     setupRequestEvent(req.upload, "error", details.upload);
@@ -81,6 +82,9 @@ function(safeUrl, details, req) {
81 82
   if (details.overrideMimeType) {
82 83
     req.overrideMimeType(details.overrideMimeType);
83 84
   }
  85
+  if (details.timeout) {
  86
+    req.timeout = details.timeout;
  87
+  }
84 88
 
85 89
   if (details.headers) {
86 90
     var headers = details.headers;

0 notes on commit b4ecc6f

Please sign in to comment.
Something went wrong with that request. Please try again.