Issue #991 Part 2: Basilisk

This commit is contained in:
Ascrod 2019-04-08 19:58:00 -04:00 committed by Roy Tam
commit 5d978c380c
13 changed files with 30 additions and 126 deletions

View file

@ -19,12 +19,7 @@ function LOG(str) {
let prefB = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch);
let shouldLog = false;
try {
shouldLog = prefB.getBoolPref("feeds.log");
}
catch (ex) {
}
let shouldLog = prefB.getBoolPref("feeds.log", false);
if (shouldLog)
dump("*** Feeds: " + str + "\n");

View file

@ -187,13 +187,8 @@ const Utils = {
// check if it is in the black list
let pb = Services.prefs;
let allowed;
try {
allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "." + aProtocol);
}
catch (e) {
allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "-default");
}
let allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "." + aProtocol,
pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "-default"));
if (!allowed) {
throw this.getSecurityError(
`Not allowed to register a protocol handler for ${aProtocol}`,