@@ -47,8 +47,10 @@ WebRTCToggle.prototype = {
4747
4848 // add to category manager
4949 _xpcom_categories : [ { category : "profile-after-change" } ] ,
50+
51+ prefBranch : null ,
5052
51- observe : function ( aSubject , aTopic , aData )
53+ observe : function ( aSubject , aTopic , aData )
5254 {
5355 switch ( aTopic )
5456 {
@@ -58,10 +60,10 @@ WebRTCToggle.prototype = {
5860 . getService ( Components . interfaces . nsIObserverService )
5961 . addObserver ( this , "quit-application" , false ) ;
6062
61- Components . classes [ "@mozilla.org/preferences-service;1" ]
63+ this . prefBranch = Components . classes [ "@mozilla.org/preferences-service;1" ]
6264 . getService ( Components . interfaces . nsIPrefService )
63- . getBranch ( "media.navigator.permission." )
64- . addObserver ( "" , this , false ) ;
65+ . getBranch ( "media.navigator.permission." ) ;
66+ this . prefBranch . addObserver ( "" , this , false ) ;
6567 break ;
6668 case "quit-application" :
6769 // Turn the override off when closing the application,
@@ -86,6 +88,7 @@ WebRTCToggle.prototype = {
8688 } else {
8789 message = "Automatic WebRTC connection has been turned off." ;
8890 }
91+ console . log ( message ) ;
8992
9093 var type = Components . classes [ "@mozilla.org/preferences-service;1" ]
9194 . getService ( Components . interfaces . nsIPrefService )
0 commit comments