@@ -47,8 +47,10 @@ WebRTCToggle.prototype = {
47
47
48
48
// add to category manager
49
49
_xpcom_categories : [ { category : "profile-after-change" } ] ,
50
+
51
+ prefBranch : null ,
50
52
51
- observe : function ( aSubject , aTopic , aData )
53
+ observe : function ( aSubject , aTopic , aData )
52
54
{
53
55
switch ( aTopic )
54
56
{
@@ -58,10 +60,10 @@ WebRTCToggle.prototype = {
58
60
. getService ( Components . interfaces . nsIObserverService )
59
61
. addObserver ( this , "quit-application" , false ) ;
60
62
61
- Components . classes [ "@mozilla.org/preferences-service;1" ]
63
+ this . prefBranch = Components . classes [ "@mozilla.org/preferences-service;1" ]
62
64
. getService ( Components . interfaces . nsIPrefService )
63
- . getBranch ( "media.navigator.permission." )
64
- . addObserver ( "" , this , false ) ;
65
+ . getBranch ( "media.navigator.permission." ) ;
66
+ this . prefBranch . addObserver ( "" , this , false ) ;
65
67
break ;
66
68
case "quit-application" :
67
69
// Turn the override off when closing the application,
@@ -86,6 +88,7 @@ WebRTCToggle.prototype = {
86
88
} else {
87
89
message = "Automatic WebRTC connection has been turned off." ;
88
90
}
91
+ console . log ( message ) ;
89
92
90
93
var type = Components . classes [ "@mozilla.org/preferences-service;1" ]
91
94
. getService ( Components . interfaces . nsIPrefService )
0 commit comments