github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/themes/wind/static/libs/sockjs-client-1.1.0/lib/utils/browser.js (about)

     1  'use strict';
     2  
     3  module.exports = {
     4    isOpera: function() {
     5      return global.navigator &&
     6        /opera/i.test(global.navigator.userAgent);
     7    }
     8  
     9  , isKonqueror: function() {
    10      return global.navigator &&
    11        /konqueror/i.test(global.navigator.userAgent);
    12    }
    13  
    14    // #187 wrap document.domain in try/catch because of WP8 from file:///
    15  , hasDomain: function () {
    16      // non-browser client always has a domain
    17      if (!global.document) {
    18        return true;
    19      }
    20  
    21      try {
    22        return !!global.document.domain;
    23      } catch (e) {
    24        return false;
    25      }
    26    }
    27  };