Bug 1365852 - immediately return in updateIndicatorState() if webrtcIndicator hasn't finished loading. r?florian draft
authorMunro Mengjue Chiang <mchiang@mozilla.com>
Tue, 13 Jun 2017 16:50:19 +0800
changeset 593954 f057d1935f70fecff2b530e735da8acd8fed5220
parent 593717 b266a8d8fd595b84a7d6218d7b8c6b7af0b5027c
child 633292 e693351f8666f81a4e26fa1c66b718cb7abfb01e
push id63891
push userbmo:mchiang@mozilla.com
push dateWed, 14 Jun 2017 10:20:57 +0000
reviewersflorian
bugs1365852
milestone56.0a1
Bug 1365852 - immediately return in updateIndicatorState() if webrtcIndicator hasn't finished loading. r?florian MozReview-Commit-ID: D6MZn6khaJO
browser/base/content/webrtcIndicator.js
--- a/browser/base/content/webrtcIndicator.js
+++ b/browser/base/content/webrtcIndicator.js
@@ -34,16 +34,20 @@ function init(event) {
   // Alert accessibility implementations stuff just changed. We only need to do
   // this initially, because changes after this will automatically fire alert
   // events if things change materially.
   let ev = new CustomEvent("AlertActive", {bubbles: true, cancelable: true});
   document.documentElement.dispatchEvent(ev);
 }
 
 function updateIndicatorState() {
+  // If gStringBundle isn't set, the window hasn't finished loading.
+  if (!gStringBundle)
+    return;
+
   updateWindowAttr("sharingvideo", webrtcUI.showCameraIndicator);
   updateWindowAttr("sharingaudio", webrtcUI.showMicrophoneIndicator);
   updateWindowAttr("sharingscreen", webrtcUI.showScreenSharingIndicator);
 
   // Camera and microphone button tooltip.
   let shareTypes = [];
   if (webrtcUI.showCameraIndicator)
     shareTypes.push("Camera");