[Feature] Ability to skip/or close the page opened by `browser.launch`
See original GitHub issueVersion: https://github.com/microsoft/playwright/commit/d367a2ed3a2d583e5e82d27ac1f53caddd8aa943 (current master)
When running this script it opens two pages (and I think two contexts)
- one after
chromium.launch
- the other after
context.newPage
const { chromium, devices } = require("playwright");
const iPhone = devices["iPhone 6"];
(async () => {
const browser = await chromium.launch({ headless: false });
const context = await browser.newContext({
viewport: iPhone.viewport,
userAgent: iPhone.userAgent
});
const page = await context.newPage();
})();
I would like to close the page opened by chromium.launch
, or skip opening it in the first place. Since it is confusing to have a blank page that is not in use (https://github.com/qawolf/qawolf/issues/395).
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Window.close() - Web APIs - MDN Web Docs - Mozilla
close () method closes the current window, or the window on which it was called. This method can only be called on windows...
Read more >Scraping the web with Playwright | ScrapingBee
Playwright is a browser automation library for Node.js (similar ... This comes in handy when scraping data from several web pages at once....
Read more >window.close and self.close do not close the window in Chrome
open () will the new window be able to close using code as I have mentioned above. This works perfectly for me :)...
Read more >How To Scrape a Website Using Node.js and Puppeteer
Step 3 — Scraping Data from a Single Page. Before adding more functionality to your scraper application, open your preferred web browser and ......
Read more >puppeteer.Page.close JavaScript and Node.js code examples
Scrolls the page and gets the page content using PhantomJS async function getPageData(pageUrl, shouldScrollPage) { const browser = await puppeteer.launch(); ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Should be fixed by now in Chromium and WebKit. Still has an extra tab in FF, but that is probably Ok for now.
Thanks for the report. We are going to get there, but it’ll take some time. In order to implement it we need to introduce a new mode in all the browsers that does not open the default profile on browser startup.