Skip to content

Instantly share code, notes, and snippets.

@doodlemoonch
Created March 15, 2023 15:00
Show Gist options
  • Save doodlemoonch/8b8c8cb40c9aa28b19b8341fcb1f2958 to your computer and use it in GitHub Desktop.
Save doodlemoonch/8b8c8cb40c9aa28b19b8341fcb1f2958 to your computer and use it in GitHub Desktop.
Debug when cookies are set
origDescriptor = Object.getOwnPropertyDescriptor(Document.prototype, 'cookie');
Object.defineProperty(document, 'cookie', {
get() {
return origDescriptor.get.call(this);
},
set(value) {
debugger;
return origDescriptor.set.call(this, value);
},
enumerable: true,
configurable: true
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment