navigator.mozApps is undefined on FxOS booting.

RESOLVED WORKSFORME

Status

Core Graveyard
DOM: Apps
RESOLVED WORKSFORME
4 years ago
4 months ago

People

(Reporter: alive, Unassigned)

Tracking

Trunk
x86
Mac OS X

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

While working on bug 940164,
I find that navigator.mozApps are undefined until several try.
### Codes

      for (var api in this.REGISTRY) {
        this.debug('Detecting API: ' + api + ' and corresponding module: ' + this.REGISTRY[api]);
        if (navigator[api]) {
          this.startAPIHandler(api, this.REGISTRY[api]);
        } else {
          this.debug('API: ' + api + ' not found..retry!');
          var self = this;
          var interval = window.setInterval(function() {
            if (navigator[api]) {
              window.clearInterval(interval);
              self.debug(api + ' found!!!');
            } else {
              self.debug(api + ' not ready yet..')
            }
          }, 1000);
        }
      }

### Logging
"[SystemApp][1.141] Detecting API: mozApps and corresponding module: ApplicationsMediator" app.js:16
"[SystemApp][1.141] API: mozApps not found..retry!" app.js:16
"[SystemApp][2.750] mozApps not ready yet.." app.js:16
"[SystemApp][3.355] mozApps found!!!"

Fabrice, are you aware of this? Is it intentional or something we cannot resolve?
Flags: needinfo?(fabrice)
I had that problem in bug 1035867, which was a regression from bug 903291.  We ended up fixing it by removing some unnecessary code, although it never made sense for that code to cause the problem, and I continue to suspect a regression from bug 903291.
Yes, that should not happen. Do you have a logcat?
Flags: needinfo?(fabrice)
Created attachment 8471287 [details]
0812.log

Logcat
(In reply to Fabrice Desré [:fabrice] from comment #2)
> Yes, that should not happen. Do you have a logcat?

Not sure what kind of log you need but I attach the full logcat.
From the log you could see we have navigator.mozApps at 5nd retry.

E/GeckoConsole(  306): Content JS LOG at app://system.gaiamobile.org/js/app.js:16 in awm_debug: [SystemApp][1.825] API: mozApps not found yet..19
E/QCALOG  (  438): [MessageQ] ProcessNewMessage: [XTWiFi-PE] unknown deliver target [OS-Agent]
E/QCALOG  (  438): [MessageQ] ProcessNewMessage: [XT-CS] unknown deliver target [OS-Agent]
E/QCALOG  (  438): [MessageQ] ProcessNewMessage: [XTWWAN-PE] unknown deliver target [OS-Agent]
D/wpa_supplicant(  998): EAPOL: disable timer tick
D/wpa_supplicant(  998): EAPOL: Supplicant port status: Unauthorized
D/wpa_supplicant(  998): nl80211: Event message available
D/wpa_supplicant(  998): nl80211: Regulatory domain change
D/wpa_supplicant(  998): wlan0: Event CHANNEL_LIST_CHANGED (31) received
D/wpa_supplicant(  998): nl80211: Regulatory information - country=00
D/wpa_supplicant(  998): nl80211: 2402-2472 @ 40 MHz
D/wpa_supplicant(  998): nl80211: 2457-2482 @ 40 MHz
D/wpa_supplicant(  998): nl80211: 2474-2494 @ 20 MHz
D/wpa_supplicant(  998): nl80211: 5170-5250 @ 40 MHz
D/wpa_supplicant(  998): nl80211: 5735-5835 @ 40 MHz
D/wpa_supplicant(  998): nl80211: Added 802.11b mode based on 802.11g information
D/wpa_supplicant(  998): P2P: Add operating class 81
D/wpa_supplicant(  998): P2P: Channels - hexdump(len=11): 01 02 03 04 05 06 07 08 09 0a 0b
D/wpa_supplicant(  998): wlan0: P2P: Update channel list
I/GeckoDump(  306):  -*- Shell.js: Starting USB debugger on /data/local/debugger-socket
E/GeckoConsole(  306): Content JS LOG at app://system.gaiamobile.org/js/app.js:16 in awm_debug: [SystemApp][2.980] API: mozApps not found yet..18
E/GeckoConsole(  306): Content JS LOG at app://system.gaiamobile.org/js/app.js:16 in awm_debug: [SystemApp][2.994] API: mozApps not found yet..17
E/GeckoConsole(  306): Content JS LOG at app://system.gaiamobile.org/js/app.js:16 in awm_debug: [SystemApp][3.288] API: mozApps not found yet..16
E/GeckoConsole(  306): Content JS LOG at app://system.gaiamobile.org/js/app.js:16 in awm_debug: [SystemApp][3.680] API: mozApps found, starting the handler.
hm, that's not enough. Alive, can you attach your debug patch?
Flags: needinfo?(alive)
(In reply to Fabrice Desré [:fabrice] from comment #5)
> hm, that's not enough. Alive, can you attach your debug patch?

https://github.com/alivedise/gaia/compare/system2?expand=1

Lemme know if you have difficulty running it.
Flags: needinfo?(alive)
This doesn't happen anymore when I updated my gecko. Closing. Sorry for disturbing.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WORKSFORME

Updated

4 months ago
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.