i am launching a headfull browser while disabling the default view port size
<code>const browser = await puppeteer.launch({
headless: false,
debuggingPort: 9222,
defaultViewport: null
});
const page = await browser.newPage();
await page.goto("https://stackoverflow.com");
</code>
<code>const browser = await puppeteer.launch({
headless: false,
debuggingPort: 9222,
defaultViewport: null
});
const page = await browser.newPage();
await page.goto("https://stackoverflow.com");
</code>
const browser = await puppeteer.launch({
headless: false,
debuggingPort: 9222,
defaultViewport: null
});
const page = await browser.newPage();
await page.goto("https://stackoverflow.com");
as expected, the view port matches the window size.
i am reusing the browser by connecting it through a websocket and then opening a page. but the view port of the page does not match the window size (it defaults to 800×600).
<code>const browserURL = "http://localhost:9222";
const browser = await puppeteer.connect({browserURL});
const page = await browser.newPage();
await page.goto("https://stackoverflow.com");
</code>
<code>const browserURL = "http://localhost:9222";
const browser = await puppeteer.connect({browserURL});
const page = await browser.newPage();
await page.goto("https://stackoverflow.com");
</code>
const browserURL = "http://localhost:9222";
const browser = await puppeteer.connect({browserURL});
const page = await browser.newPage();
await page.goto("https://stackoverflow.com");
the view port size can be changed by calling
<code>await page.setViewport({ width: 1080, height: 1024 });
</code>
<code>await page.setViewport({ width: 1080, height: 1024 });
</code>
await page.setViewport({ width: 1080, height: 1024 });
- why the view port size is different when connecting to the browser?
- how can can i set the view port size to match the window size when connecting to the browser?
- can the view port be configured to always match the window size?