summaryrefslogtreecommitdiffstats
path: root/uriloader
diff options
context:
space:
mode:
authorAscrod <32915892+Ascrod@users.noreply.github.com>2019-04-08 20:36:18 -0400
committerAscrod <32915892+Ascrod@users.noreply.github.com>2019-04-13 11:37:45 -0400
commitc7796280a9b5600fb15a4c170ca3d3f4d4d9e535 (patch)
tree9e1fbdd8600e3ed4d7747dbdd8cb11bdb431d287 /uriloader
parent609a7215e6ef705fd098fd4adb4f922795ff1119 (diff)
downloadUXP-c7796280a9b5600fb15a4c170ca3d3f4d4d9e535.tar
UXP-c7796280a9b5600fb15a4c170ca3d3f4d4d9e535.tar.gz
UXP-c7796280a9b5600fb15a4c170ca3d3f4d4d9e535.tar.lz
UXP-c7796280a9b5600fb15a4c170ca3d3f4d4d9e535.tar.xz
UXP-c7796280a9b5600fb15a4c170ca3d3f4d4d9e535.zip
Issue #991 Part 4: Network and URILoader
Diffstat (limited to 'uriloader')
-rw-r--r--uriloader/exthandler/nsHandlerService.js16
1 files changed, 5 insertions, 11 deletions
diff --git a/uriloader/exthandler/nsHandlerService.js b/uriloader/exthandler/nsHandlerService.js
index c932f9f5d..5e6356ac2 100644
--- a/uriloader/exthandler/nsHandlerService.js
+++ b/uriloader/exthandler/nsHandlerService.js
@@ -352,17 +352,11 @@ HandlerService.prototype = {
var prefSvc = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefService);
var prefBranch = prefSvc.getBranch("network.protocol-handler.");
- try {
- alwaysAsk = prefBranch.getBoolPref("warn-external." + type);
- } catch (e) {
- // will throw if pref didn't exist.
- try {
- alwaysAsk = prefBranch.getBoolPref("warn-external-default");
- } catch (e) {
- // Nothing to tell us what to do, so be paranoid and prompt.
- alwaysAsk = true;
- }
- }
+ // If neither of the prefs exists, be paranoid and prompt.
+ alwaysAsk =
+ prefBranch.getBoolPref("warn-external." + type,
+ prefBranch.getBoolPref("warn-external-default",
+ true));
}
aHandlerInfo.alwaysAskBeforeHandling = alwaysAsk;