Skip to content

Instantly share code, notes, and snippets.

@rubo77
Last active August 29, 2015 14:02
Show Gist options
  • Save rubo77/21d03191015fd7e618aa to your computer and use it in GitHub Desktop.
Save rubo77/21d03191015fd7e618aa to your computer and use it in GitHub Desktop.
this is my main.js for the firefox addon to set `network.http.response.timeout` to 24 hours.
const {Cc,Ci,Cu} = require("chrome");
var pref = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
pref.setIntPref("network.http.response.timeout", 3600*24);
/* This contentStyle hides an element with
* id="hidden_by_addon_response_timeout_24_hours"
* on all webpages, so you can notify the User if it is not installed */
require('sdk/page-mod').PageMod({
include: '*',
contentStyle: [
"#hidden_by_addon_response_timeout_24_hours { display:none }"
]
})
@rubo77
Copy link
Author

rubo77 commented Jun 3, 2014

This Plugin sets network.http.response.timeout to 24 hours.

The setting network.http.response.timeout was changed from not being set in
Firefox version 28 to a default limit of 300 seconds (5 minutes) in version 29.
You probably won’t notice this, unless you work with a page that has a long-running
process that you have to wait more than 5 minutes for a response from.

To solve this, you can update this setting manually in about:config.
Or better yet, you can do it by installing this Add-On into firefox.

Detecting if this Add-On is active

check the HTTP_USER_AGENT for minimum Firefox 29 to be installed and if so,
then you can simply give out an info if you add this block to your website:

<span id="hidden_by_addon_response_timeout_24_hours">Please install the AddOn</span>

This info will be hidden, once the AddOn is installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment