browser.js 560 B

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