Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Incognito context page won't authenticate to proxy after Monterey update? #7827

Closed
DavideValdo opened this issue Dec 7, 2021 · 3 comments

Comments

@DavideValdo
Copy link

DavideValdo commented Dec 7, 2021

Bug description

Doesn't happen in the remote Ubuntu 18 server executing the same code

Steps to reproduce the problem:

  1. Update to macOS Monterey
  2. Run a node script that launches puppeteer like this (dotenv is working correctly, double-checked):
const browser = 
await puppeteer.launch({
      args: [
        `--proxy-server=${process.env.PROXY_URL}`,
        "--no-sandbox",
        "--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36",
      ],
      headless: true,
    });
    
const context = await browser.createIncognitoBrowserContext();

const page = await context.newPage();

// Disable images altogether
await page.setRequestInterception(true);
page.on("request", (req) => {
    if (req.resourceType() === "image") {
    req.abort();
    return;
    }

    req.continue();
});

await page.authenticate({
    username: process.env.USERNAME,
    password: process.env.PASSWORD,
});

  1. Been trying both headless and headful modes, when running headful if I try to open a new tab in the same browser window, I get prompted for proxy login credentials

Any logs I'm missing? The above code is wrapped in a try/catch block but won't throw exceptions.

Puppeteer version

remote: 10.4.0, locally: 10.4.0 (tried 12.0.1)

Node.js version

remote: 14.7.5, local: 16.13.1

npm version

local: 8.2.0

What operating system are you seeing the problem on?

macOS

Relevant log output

No response

@DavideValdo DavideValdo added the bug label Dec 7, 2021
@DavideValdo DavideValdo changed the title [Bug]: Puppeteer incognito context page won't authenticate to proxy after Monterey update? [Bug]: Incognito context page won't authenticate to proxy after Monterey update? Dec 8, 2021
@roudhentelnagoy
Copy link

roudhentelnagoy commented Mar 31, 2022

Incognito is not using the proxy server declared when you launch the browser. You need to pass the proxyServer when you create new incognito browser context

await browser.createIncognitoBrowserContext({ proxyServer: 'http://host:port' })

@stale
Copy link

stale bot commented Jun 23, 2022

We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.

@stale stale bot added the unconfirmed label Jun 23, 2022
@stale
Copy link

stale bot commented Jul 23, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants