t-comm
Version:
专业、稳定、纯粹的工具库
36 lines (31 loc) • 726 B
JavaScript
;
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;