Last active
August 29, 2015 14:02
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }" | |
] | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This Plugin sets
network.http.response.timeout
to 24 hours.The setting
network.http.response.timeout
was changed from not being set inFirefox 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:
This info will be hidden, once the AddOn is installed.