interceptor missing (not intercepting) multiple requests
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: 3.3.0
- Platform / OS version: Win10/64bit
- URLs (if applicable): kbb.com
- Node.js version: 10.16.3
What steps will reproduce the problem? See code below. I expected that ALL requests will pass through the interceptor, but many requests that appear in DevTools are never acknowledged, thus no opportunity to “catch.”. #4329 is similar, but was resolved via bugfix in 1.15, however I’m on 3.3.
Please include code that reproduces the issue. (code block below)
What is the expected result?
I expect that the call to https://accounts.us1.gigya.com/accounts.login to be intercepted.
What happens instead?
It is ignored in the interception code block page.on('request', ... The request goes through without the opportunity to intercept. For debugging purposes, the interception block writes all URL’s to console after we set clicked=true, but this URL doesn’t appear there.
(the call to https://accounts.us1.gigya.com/socialize.getSavedResponse also fails to be recognized by the interception code block)
code:
const puppeteer = require('puppeteer');
const getPuppeteer = async () => {
let browser = await puppeteer.launch({
timeout: 120000,
headless: false,
devtools: true,
//slowMo: 100,
});
return new Promise((resolve, reject) => {
resolve(browser)
});
}
async function kbb() {
let exclusions = /\.gif|\.png|\.jpg|\.ttf|facebook|doubleclick|nr-data|foresee|demdex|pinterest|yimg|clarivoy|marinsm|mavenaudiences|go-mpulse|zemanta|esm1|adnxs|adsrvr|rockerbox|arrivalist|googleads|googlesyndication|google-analytics|googletagmanager/;
let clicked = false;
let browser = await getPuppeteer(); //cloud || false);
try {
const page = await browser.newPage();
// this is our interceptor, where we capture the browser's POST
page.on('request', async(request) => {
if (clicked) console.log(request.url() + "\n") // display ALL request URLs after the "Sign In" button was clicked
if (request.url().search(/login/g) > 0) {
// if (request.method == "POST") {
// if (request.url().includes("accounts.login")) {
console.log("yes!")
console.log(request.url());
console.log(request.method());
let body = request.postData();
console.log(body);
request.abort();
} else if (request.url().search(exclusions) > 0) {
request.abort();
} else {
request.continue();
}
});
await page.setRequestInterception(true);
await page.goto("https://www.kbb.com/mykbb/");
await page.waitForSelector(".mykbb-auth");
await page.type("#loginEmail", 'githubuser@gmail.com');
await page.type("#loginPassword", 'ilovecars');
console.log("clicking...");
clicked = true; // set to true just before clicking... for debugging we can set the interceptor to catch everything when true
await page.click("#myKbbSignin");
} catch(err) {
console.log(err);
} finally {
if (browser) {
// browser.close();
// browser.disconnect();
}
}
}
(async () => {
let my_kbb = await kbb()
console.log("done!")
})();
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:5

Top Related StackOverflow Question
Exact same issue as well, puppeteer 5.5.0. Seems to miss specific types of types. like .m3u8 or .ts (streaming files). #5130
We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!