ayakashi
Version:
The next generation web scraping framework
16 lines (15 loc) • 643 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function default_1() {
// store the existing descriptor
const elementDescriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, "offsetHeight");
// redefine the property with a patched descriptor
Object.defineProperty(HTMLDivElement.prototype, "offsetHeight", Object.assign(Object.assign({}, elementDescriptor), { get: function () {
if (this.id === "modernizr") {
return 1;
}
//@ts-ignore
return elementDescriptor.get.apply(this);
} }));
}
exports.default = default_1;