cookies.__proto__.get = function(domain) {
var domain_cookies = [];
for (var c = 0; c < this.length; c++) {
if (this[c]['domain'].includes(domain)) {
domain_cookies.push(this[c]['name'] + '=' + this[c]['value']);
}
}
return domain_cookies.join('; ');
}
cookies.get('roseltorg.ru');
const target = {
cookies
};
const handler = {
get: function(target, domain) {
var domain_cookies = [];
for (var c = 0; c < target.length; c++) {
if (target[c]['domain'].includes(domain)) {
domain_cookies.push(target[c]['name'] + '=' + target[c]['value']);
}
}
return domain_cookies.join('; ');
}
};
const proxy = new Proxy(target, handler);
console.log(proxy['somesite']);