code: 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;
          }
docs: Set listener for `visibilitychange` event.