Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const cookieDescriptor = Object.getOwnPropertyDescriptor(Document.prototype, 'cookie') || Object.getOwnPropertyDescriptor(HTMLDocument.prototype, 'cookie');
- Object.defineProperty(document, 'cookie', {
- get: function() {
- return cookieDescriptor.get.call(document);
- },
- set: function(cookieString) {
- const cookieName = cookieString.split('=')[0].trim();
- if (nem követő kuki){
- cookieDescriptor.set.call(document, cookieString);
- }
- },
- configurable: false,
- enumerable: true
- });
Advertisement
Add Comment
Please, Sign In to add comment