@ -437,6 +437,27 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
} ) ;
}
$rootScope . countWatchers = function ( ) {
var root = $ ( document . getElementsByTagName ( 'body' ) ) ;
var watchers = [ ] ;
var f = function ( element ) {
if ( element . data ( ) . hasOwnProperty ( '$scope' ) ) {
angular . forEach ( element . data ( ) . $scope . $$watchers , function ( watcher ) {
watchers . push ( watcher ) ;
} ) ;
}
angular . forEach ( element . children ( ) , function ( childElement ) {
f ( $ ( childElement ) ) ;
} ) ;
} ;
f ( root ) ;
console . log ( watchers . length ) ;
} ;
if ( window . webkitNotifications != undefined ) {
if ( window . webkitNotifications . checkPermission ( ) == 0 ) { // 0 is PERMISSION_ALLOWED
$log . info ( 'Notification permission status:' , window . webkitNotifications . checkPermission ( ) == 0 ) ;