Closed rtsao closed 5 years ago
Background:
You suggested in our conversation to try implementing setRequestInterception
And then run the same test on "/no-map", but for the "/external-map" route, where requests to the sourcemap files are intercepted and replaced with 5xx and/or 404 responses
I am currently stuck at a pending promise after setRequestInterception
.
I tried to do this:
const page = await browser.newPage();
await page.setRequestInterception(true);
let url = `http://localhost:${port}${route}`;
await page.goto(url);
page.on("console", msg => {
Promise.all(msg.args().map(a => a.jsonValue())).then(async args => {
if (args[0] === "__on_message__") {
msgHandler(args[1]);
} else if (args[0] === "Debug worker error") {
errHandler(args[1]);
}
});
});
page.on("request", interceptedRequest => {
interceptedRequest.continue();
});
await page.setRequestInterception(true);
never completes and I'm not sure how to continue from here.
I also tried upgrading to puppeteer v1.9.0 but that didn't work.
Wow, thanks!
Resolves https://github.com/rtsao/css-to-js-sourcemap/issues/19