@@ -21,7 +21,6 @@ const PREF_ACTIVITY_STREAM_DEBUG = "browser.newtabpage.activity-stream.debug";
2121// AboutHomeStartupCache needs us in "quit-application", so stay alive longer.
2222// TODO: We could better have a shared async shutdown blocker?
2323const TOPIC_APP_QUIT = "profile-before-change" ;
24- const PREF_SHOULD_INITIALIZE = "browser.newtabpage.shouldInitialize" ;
2524
2625export const AboutNewTab = {
2726 QueryInterface : ChromeUtils . generateQI ( [
@@ -51,16 +50,6 @@ export const AboutNewTab = {
5150 return ;
5251 }
5352
54- // For tests/automation: when false, newtab won't initialize in this session.
55- // Flipping after initialization has no effect on the current session.
56- const shouldInitialize = Services . prefs . getBoolPref (
57- PREF_SHOULD_INITIALIZE ,
58- true
59- ) ;
60- if ( ! shouldInitialize ) {
61- return ;
62- }
63-
6453 Services . obs . addObserver ( this , TOPIC_APP_QUIT ) ;
6554 if ( ! AppConstants . RELEASE_OR_BETA ) {
6655 XPCOMUtils . defineLazyPreferenceGetter (
@@ -249,16 +238,11 @@ export const AboutNewTab = {
249238 this . activityStream . uninit ( ) ;
250239 this . activityStream = null ;
251240 }
252- try {
253- Services . obs . removeObserver ( this , TOPIC_APP_QUIT ) ;
254- Services . obs . removeObserver (
255- this ,
256- lazy . TelemetryReportingPolicy . TELEMETRY_TOU_ACCEPTED_OR_INELIGIBLE
257- ) ;
258- } catch ( e ) {
259- // If init failed before registering these observers, removeObserver may throw.
260- // Safe to ignore during shutdown.
261- }
241+ Services . obs . removeObserver ( this , TOPIC_APP_QUIT ) ;
242+ Services . obs . removeObserver (
243+ this ,
244+ lazy . TelemetryReportingPolicy . TELEMETRY_TOU_ACCEPTED_OR_INELIGIBLE
245+ ) ;
262246
263247 this . initialized = false ;
264248 } ,
0 commit comments