playwright-fluent
Version:
Fluent API around playwright
12 lines (11 loc) • 387 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCurrentUrl = void 0;
async function getCurrentUrl(page) {
if (page) {
const url = await page.evaluate(() => window.location.href);
return url;
}
throw new Error('Cannot get current page url because no browser has been launched');
}
exports.getCurrentUrl = getCurrentUrl;