mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1204367 - Only do SafeBrowsing debug logging when debug is enabled. r=francois
This commit is contained in:
parent
e70f79b7bf
commit
a5946e9eda
@ -10,6 +10,23 @@ const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
// Log only if browser.safebrowsing.debug is true
|
||||
function log(...stuff) {
|
||||
let logging = null;
|
||||
try {
|
||||
logging = Services.prefs.getBoolPref("browser.safebrowsing.debug");
|
||||
} catch(e) {
|
||||
return;
|
||||
}
|
||||
if (!logging) {
|
||||
return;
|
||||
}
|
||||
|
||||
var d = new Date();
|
||||
let msg = "SafeBrowsing: " + d.toTimeString() + ": " + stuff.join(" ");
|
||||
dump(msg + "\n");
|
||||
}
|
||||
|
||||
// Skip all the ones containining "test", because we never need to ask for
|
||||
// updates for them.
|
||||
function getLists(prefName) {
|
||||
@ -37,17 +54,6 @@ const downloadAllowLists = getLists("urlclassifier.downloadAllowTable");
|
||||
const trackingProtectionLists = getLists("urlclassifier.trackingTable");
|
||||
const trackingProtectionWhitelists = getLists("urlclassifier.trackingWhitelistTable");
|
||||
|
||||
var debug = false;
|
||||
function log(...stuff) {
|
||||
if (!debug)
|
||||
return;
|
||||
|
||||
var d = new Date();
|
||||
let msg = "SafeBrowsing: " + d.toTimeString() + ": " + stuff.join(" ");
|
||||
Services.console.logStringMessage(msg);
|
||||
dump(msg + "\n");
|
||||
}
|
||||
|
||||
this.SafeBrowsing = {
|
||||
|
||||
init: function() {
|
||||
@ -143,7 +149,7 @@ this.SafeBrowsing = {
|
||||
readPrefs: function() {
|
||||
log("reading prefs");
|
||||
|
||||
debug = Services.prefs.getBoolPref("browser.safebrowsing.debug");
|
||||
this.debug = Services.prefs.getBoolPref("browser.safebrowsing.debug");
|
||||
this.phishingEnabled = Services.prefs.getBoolPref("browser.safebrowsing.enabled");
|
||||
this.malwareEnabled = Services.prefs.getBoolPref("browser.safebrowsing.malware.enabled");
|
||||
this.trackingEnabled = Services.prefs.getBoolPref("privacy.trackingprotection.enabled") || Services.prefs.getBoolPref("privacy.trackingprotection.pbmode.enabled");
|
||||
@ -181,7 +187,7 @@ this.SafeBrowsing = {
|
||||
this.providers[providerName] = {};
|
||||
}
|
||||
|
||||
if (debug) {
|
||||
if (this.debug) {
|
||||
let providerStr = "";
|
||||
Object.keys(this.providers).forEach(function(provider) {
|
||||
if (providerStr === "") {
|
||||
|
Loading…
Reference in New Issue
Block a user