playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[BUG] `browser.cache.disk.parent_directory` of `firefoxUserPrefs` doesn't work.

Open liuhui-eb opened this issue 2 years ago • 2 comments

System info

  • Playwright Version: [>=v1.34]
  • Operating System: [Ubuntu 22.04]
  • Browser: [Firefox]
  • Node Version: [v16.17.0]
  • Other info: Playwright version < v1.34 works well.

Source code

import {firefox} from 'playwright-firefox';

let firefoxUserPrefs = {
  'browser.cache.disk.parent_directory': '/home/harley/Documents/GitHub/playwright_test/disk_cache',
};

const browser = await firefox.launch({
  headless: false,
  firefoxUserPrefs: firefoxUserPrefs
});
console.log("==== playwright.launch done ====");
const context = await browser.newContext();
await context.newPage();

Steps

  • After Firefox launches, visit the about:config and about:cache pages.

Expected

  • In the about:config page, the browser.cache.disk.parent_directory should be set as /home/harley/Documents/GitHub/playwright_test/disk_cache.
  • In the about:cache page, the Storage disk location of the disk part should be set as /home/harley/Documents/GitHub/playwright_test/disk_cache.

Actual

  • In the about:config page, the browser.cache.disk.parent_directory is set as /home/harley/Documents/GitHub/playwright_test/disk_cache. image

  • In the about:cache page, the Storage disk location of the disk part is not set as /home/harley/Documents/GitHub/playwright_test/disk_cache. image

liuhui-eb avatar Jan 02 '24 07:01 liuhui-eb

I have read the source code of branch release-1.33 and release-1.34 and I'm wondering if it's caused by this PR: https://github.com/microsoft/playwright/pull/22998. I think this PR may set the config of Firefox after Firefox launches, but the cache setting should be set before Firefox launches or Firefox needs to be re-launched.

liuhui-eb avatar Jan 02 '24 09:01 liuhui-eb

+1 encountering same issue atm.

DemonMartin avatar Mar 12 '24 17:03 DemonMartin