lib/visibility.core.js
function () {
            if ( self._init ) {
                return;
            }

            var event = 'visibilitychange';
            if ( self._doc.webkitVisibilityState ) {
                event = 'webkit' + event;
            }

            var listener = function () {
                self._change.apply(self, arguments);
            };
            if ( self._doc.addEventListener ) {
                self._doc.addEventListener(event, listener);
            } else {
                self._doc.attachEvent(event, listener);
            }
            self._init = true;
        }
function () {
            if ( self._init ) {
                return;
            }

            var event = 'visibilitychange';
            if ( self._doc.webkitVisibilityState ) {
                event = 'webkit' + event;
            }

            var listener = function () {
                self._change.apply(self, arguments);
            };
            if ( self._doc.addEventListener ) {
                self._doc.addEventListener(event, listener);
            } else {
                self._doc.attachEvent(event, listener);
            }
            self._init = true;
        }
function ( ) { if ( self . _init ) { return ; } var event = 'visibilitychange' ; if ( self . _doc . webkitVisibilityState ) { event = 'webkit' + event ; } var listener = function ( ) { self . _change . apply ( self , arguments ) ; } ; if ( self . _doc . addEventListener ) { self . _doc . addEventListener ( event , listener ) ; } else { self . _doc . attachEvent ( event , listener ) ; } self . _init = true ; }
Set listener for `visibilitychange` event.
Set listener for visibilitychange event .