Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function isActiveWindow(page, yes = true) {
const assert = yes ? equal : notEqual;
const window = await activeWin(), path = PuppeteerBrowser.executablePath();
if ( window.owner.path )
assert(path, window.owner.path);
else
assert(path.match( /([^/]+)(\.\w+)?$/ )[1], window.owner.name);
}