Blame view

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