'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var pixui_validator = require('./validator.js');

var isHooked = false;
function proxyCookie() {
  var str = '';
  Object.defineProperty(document, 'cookie', {
    get: function get() {
      return str;
    },
    set: function set(value) {
      str = value;
    }
  });
}
function hook() {
  // @ts-ignore
  if (typeof H5ElementTag !== 'undefined') {
    // @ts-ignore
    H5ElementTag.prototype.pathname = '';
  }
  document.cookie = '';
  proxyCookie();
}
function networkHookInPixui() {
  if (pixui_validator.isBrowserInPixui()) return;
  if (isHooked) return;
  isHooked = true;
  hook();
}

exports.networkHookInPixui = networkHookInPixui;
