From 94415dea53acc530cca5645165784c8d413cd558 Mon Sep 17 00:00:00 2001 From: Christoph Kerschbaumer Date: Wed, 3 Jul 2019 11:55:24 +0000 Subject: [PATCH] Bug 1497214: Apply Meta CSP to about:url-classifier. Differential Revision: https://phabricator.services.mozilla.com/D36738 --HG-- extra : moz-landing-system : lando --- modules/libpref/init/all.js | 2 +- toolkit/content/aboutUrlClassifier.js | 13 ++++--------- toolkit/content/aboutUrlClassifier.xhtml | 3 ++- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index eb248f29c827..d4598daffbf5 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -2512,7 +2512,7 @@ pref("security.dialog_enable_delay", 1000); pref("security.notification_enable_delay", 500); #if defined(DEBUG) && !defined(ANDROID) -pref("csp.about_uris_without_csp", "blank,printpreview,srcdoc,addons,cache-entry,config,debugging,devtools,downloads,home,newtab,plugins,preferences,serviceworkers,sessionrestore,support,sync-log,telemetry,url-classifier,welcomeback"); +pref("csp.about_uris_without_csp", "blank,printpreview,srcdoc,addons,cache-entry,config,debugging,devtools,downloads,home,newtab,plugins,preferences,serviceworkers,sessionrestore,support,sync-log,telemetry,welcomeback"); // the following prefs are for testing purposes only. pref("csp.overrule_about_uris_without_csp_whitelist", false); pref("csp.skip_about_page_has_csp_assert", false); diff --git a/toolkit/content/aboutUrlClassifier.js b/toolkit/content/aboutUrlClassifier.js index 276230b3b705..6cd124f1500f 100644 --- a/toolkit/content/aboutUrlClassifier.js +++ b/toolkit/content/aboutUrlClassifier.js @@ -8,24 +8,19 @@ const UPDATE_BEGIN = "safebrowsing-update-begin"; const UPDATE_FINISH = "safebrowsing-update-finished"; const JSLOG_PREF = "browser.safebrowsing.debug"; -function unLoad() { - window.removeEventListener("unload", unLoad); - +window.onunload = function() { Search.uninit(); Provider.uninit(); Cache.uninit(); Debug.uninit(); -} - -function onLoad() { - window.removeEventListener("load", onLoad); - window.addEventListener("unload", unLoad); +}; +window.onload = function() { Search.init(); Provider.init(); Cache.init(); Debug.init(); -} +}; /* * Search diff --git a/toolkit/content/aboutUrlClassifier.xhtml b/toolkit/content/aboutUrlClassifier.xhtml index 89aac0032cf3..f0eea6c71e8c 100644 --- a/toolkit/content/aboutUrlClassifier.xhtml +++ b/toolkit/content/aboutUrlClassifier.xhtml @@ -10,13 +10,14 @@ + - +