Bug 685466 [element.onSecurityChange is not a function] on every tab change. r=Neil a=Callek for comm-aurora/comm-beta.
authorPhilip Chee <philip.chee@gmail.com>
Thu, 15 Sep 2011 23:42:33 +0800
changeset 21324 5b983ed2ca5a8568d339f2916efa3b66fdcd9bfd
parent 21323 1c74bb2ef964982a80103d9ab5b03ce0e96bedb2
child 21325 cbfc2237d3f3f43b3e1200763aa32da26677acce
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil, Callek
bugs685466
Bug 685466 [element.onSecurityChange is not a function] on every tab change. r=Neil a=Callek for comm-aurora/comm-beta.
suite/browser/tabbrowser.xml
--- a/suite/browser/tabbrowser.xml
+++ b/suite/browser/tabbrowser.xml
@@ -883,19 +883,20 @@
         <parameter name="aSecurityUI"/>
         <parameter name="aBrowser"/>
         <parameter name="aFeeds"/>
         <body>
           <![CDATA[
             this.mProgressListeners.forEach(
               function notifyUrlBar(element) {
                 try {
-                  element.onLocationChange(aWebProgress, aRequest, aLocation);
+                  if ("onLocationChange" in element)
+                    element.onLocationChange(aWebProgress, aRequest, aLocation);
                   // If switching tabs, the security may have changed.
-                  if (aSecurityUI)
+                  if (aSecurityUI && "onSecurityChange" in element)
                     element.onSecurityChange(aWebProgress, null, aSecurityUI.state);
                   // If the document already exists, just resend cached data.
                   if (!aRequest && aWebProgress.DOMWindow == aBrowser.contentWindow) {
                     if (aBrowser.mIconURL && "onLinkIconAvailable" in element)
                       element.onLinkIconAvailable(aBrowser.mIconURL);
                     if ("onFeedAvailable" in element) {
                       aFeeds.forEach(
                         function notifyFeedAvailable(feed) {