diff --git a/dom/ipc/components.conf b/dom/ipc/components.conf index a53c23402830..c027392f4b45 100644 --- a/dom/ipc/components.conf +++ b/dom/ipc/components.conf @@ -12,5 +12,6 @@ Classes = [ 'singleton': True, 'headers': ['/dom/ipc/LoginDetectionService.h'], 'constructor': 'mozilla::dom::LoginDetectionService::GetSingleton', + 'processes': ProcessSelector.MAIN_PROCESS_ONLY, }, ] diff --git a/mobile/android/components/geckoview/GeckoViewStartup.jsm b/mobile/android/components/geckoview/GeckoViewStartup.jsm index 2f913e27ffa3..938c8512a473 100644 --- a/mobile/android/components/geckoview/GeckoViewStartup.jsm +++ b/mobile/android/components/geckoview/GeckoViewStartup.jsm @@ -21,6 +21,14 @@ XPCOMUtils.defineLazyModuleGetters(this, { const { debug, warn } = GeckoViewUtils.initLogging("Startup"); +var { DelayedInit } = ChromeUtils.import( + "resource://gre/modules/DelayedInit.jsm" +); + +function InitLater(fn, object, name) { + return DelayedInit.schedule(fn, object, name, 15000 /* 15s max wait */); +} + const JSWINDOWACTORS = { LoadURIDelegate: { child: { @@ -56,6 +64,10 @@ class GeckoViewStartup { switch (aTopic) { case "app-startup": { // Parent and content process. + EventDispatcher.instance.registerListener(this, [ + "GeckoView:StorageDelegate:Attached", + ]); + GeckoViewUtils.addLazyGetter(this, "GeckoViewPermission", { service: "@mozilla.org/content-permission/prompt;1", observers: [ @@ -240,6 +252,15 @@ class GeckoViewStartup { pls ); break; + + case "GeckoView:StorageDelegate:Attached": + InitLater(() => { + const loginDetection = Cc[ + "@mozilla.org/login-detection-service;1" + ].createInstance(Ci.nsILoginDetectionService); + loginDetection.init(); + }); + break; } } } diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/Autocomplete.java b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/Autocomplete.java index 1600dad0bac9..8c02b3b42367 100644 --- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/Autocomplete.java +++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/Autocomplete.java @@ -1288,6 +1288,7 @@ public class Autocomplete { public StorageProxy() {} private void registerListener() { + EventDispatcher.getInstance().dispatch("GeckoView:StorageDelegate:Attached", null); EventDispatcher.getInstance() .registerUiThreadListener( this,