Bug 1394601 - Log an error when the Google API key is missing during Safe Browsing initialization. r?gcp
MozReview-Commit-ID: DNwa9lR0J6K
--- a/toolkit/components/url-classifier/SafeBrowsing.jsm
+++ b/toolkit/components/url-classifier/SafeBrowsing.jsm
@@ -300,16 +300,17 @@ this.SafeBrowsing = {
"browser.safebrowsing.provider." + provider + ".gethashURL");
updateURL = updateURL.replace("SAFEBROWSING_ID", clientID);
gethashURL = gethashURL.replace("SAFEBROWSING_ID", clientID);
// Disable updates and gethash if the Google API key is missing.
let googleKey = Services.urlFormatter.formatURL("%GOOGLE_API_KEY%").trim();
if ((provider == "google" || provider == "google4") &&
(!googleKey || googleKey == "no-google-api-key")) {
+ log("Missing Google API key, clearing updateURL and gethashURL.");
updateURL = "";
gethashURL = "";
}
log("Provider: " + provider + " updateURL=" + updateURL);
log("Provider: " + provider + " gethashURL=" + gethashURL);
// Urls used to update DB