Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let Super = null;
try {
Super = require('puppeteer/lib/FrameManager').Frame;
} catch (error) {
Super = require('puppeteer-core/lib/FrameManager').Frame;
}
Super.prototype.count = function (selector) {
return this.evaluate(
(selector) => {
return document.querySelectorAll(selector).length;
},
selector
);
};
Super.prototype.exists = function (selector) {
return this.evaluate(
(selector) => {
return document.querySelector(selector) !== null;
},