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] FF - launchPersistentContext #2979

Closed
ruslanx3m opened this issue Jul 16, 2020 · 5 comments
Closed

[BUG] FF - launchPersistentContext #2979

ruslanx3m opened this issue Jul 16, 2020 · 5 comments

Comments

@ruslanx3m
Copy link

ruslanx3m commented Jul 16, 2020

Снимок экрана (82)
Context:

  • Playwright Version: [1.2.1]
  • Operating System: [Windows]
  • Node version: [12]
  • Browser: [Firefox]

Codet

const { firefox } = require("playwright");
const path = require("path");
const fs = require("fs-extra");

(async () => {
    const ff_profile = path.join(__dirname, '/profile');
    await fs.ensureDir(ff_profile);

    const browserContext = await firefox.launchPersistentContext(ff_profile, {
        headless: false,     
        viewport: null
    });
    
    const page = await browserContext.newPage();
    await page.goto('http://example.com');

    await page.waitForTimeout(10000);
    await browserContext.close();
})();

Describe the bug

Hi, with Firefox browser, this code is opening 2 browsers if I use const page = await browserContext.newPage(), or is opening 1 browser if is use const page = browserContext.pages()[0], but in my case page.close will close browser .. so every opened page is a new Browser ... if I add to option locale: 'de-DE' - opens 3 browsers ...

@ruslanx3m ruslanx3m changed the title [BUG] [BUG] FF - launchPersistentContext Jul 16, 2020
@aslushnikov
Copy link
Collaborator

Hey @ruslanx3m,

So what doesn't work? Is it purely aesthetics that bother you?

@ruslanx3m
Copy link
Author

Hey @ruslanx3m,

So what doesn't work? Is it purely aesthetics that bother you?

I can close 1 browser and work on second ... why I need 1 browser ? but ..

if u say, ok ... 8GB or 16GB ram - Is it purely aesthetics that bother you??

@aslushnikov
Copy link
Collaborator

if u say, ok ... 8GB or 16GB ram - Is it purely aesthetics that bother you??

@ruslanx3m since we talk about browser windows, not browsers, the memory overhead should be negligible. Especially if you keep the first page empty.

Do you have any measurements that show that extra page consumes 8GB of ram?

@ruslanx3m
Copy link
Author

if u say, ok ... 8GB or 16GB ram - Is it purely aesthetics that bother you??

@ruslanx3m since we talk about browser windows, not browsers, the memory overhead should be negligible. Especially if you keep the first page empty.

Do you have any measurements that show that extra page consumes 8GB of ram?

@ruslanx3m
Copy link
Author

Do you have any measurements that show that extra page consumes 8GB of ram?

yes, have ... why u just not test code to see what is problem, is just double use memory, normal 180MB, but this code use 340MB (await browserContext..pages()[0] vs await browserContext.newPage()) ... why newPage (tab) open new browser window ?

firefox.launchPersistentContext - open 1 browser window (is normal)
browserContext.newPage() - open another browser window (is not normal, must open 1 tab in this browser)

so its memory leak .. but if I open 10 tests or more my pc memory will end .. but if you say 'Is it purely aesthetics' will go back to puppeteer (purely aesthetics) ...

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

No branches or pull requests

2 participants