-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[Feature] How to pass a policies.json to firefox launch #18115
Comments
@enrialonso You can specify user preferences instead. For example, to block export default {
use: {
launchOptions: {
firefoxUserPrefs: {
'general.aboutConfig.enable': false,
},
},
},
}; If you launch browser manually: import { firefox } from '@playwright/test';
await firefox.launch({
headless: false,
firefoxUserPrefs: {
'general.aboutConfig.enable': false,
},
}); Let me know if this helps. |
@dgozman thx for the quick reply but I have special interest on policies, this example for the about configuration. For example for firefox we can't put a security device for authentication, the method for load programaticaly the security device is put then on the policies. In this link you can look the config of the policies, how to set this on playwright is my question. this link speak about that, I test on my firefox broser and works fine, but can't do this on playwright. https://support.mozilla.org/en-US/kb/customizing-firefox-using-policiesjson Any idea? |
@enrialonso It is not possible to provide |
This would be crucial to be able to load root ca certificates on linux. Currently I haven't found any way to get certificates installed in firefox without using a persistent profile. Which can not be configured on "project" level either ( kind of related to #11833) Interestingly firefox also does not pickup a policies.json if placed in the distribution folder of the playwright provided firefox. (~/.cache/ms-playwright/firefox-1408/firefox/distribution) Unsure how playwright manages to prevent that behaviour from firefox as documented here: https://github.com/mozilla/policy-templates/blob/master/README.md |
Yep, I’m having the same issue as described in #18115 (comment); |
Playwright is modifying the firefox source code to hardcode the disablement of enterprise policies. (see https://github.com/microsoft/playwright/blob/dd1a9f5e9637c37b25ca05e83c860b32abb7930d/browser_patches/firefox/patches/bootstrap.diff) I worked around this on linux by unzipping the omni.ja (zip file), modifying EnterprisePoliciesParent.sys.mjs to undo that part of the patch and then zipping it up again. After making that change, putting the policies.json in It would be really helpful if playwright could support enterprise policies in firefox using a config option. Perhaps it could switch it on in EnterprisePoliciesParent.sys.mjs using an environment variable, or perhaps even a custom firefox config option? |
+1 for adding a way to configure the profiles / policies |
Hi! I need launch a firefox browser but with a somes policies.json. How can do this with playwright?
On Firefox you can create a
distribution
folder on the instalation path for Firefox and set the policies for the browser, here speak about thisI am test on Ubuntu 22 and my distribution firefox browser read the policies and apply then, but playwright for some reason can't read this and not apply the policies en the firefox browser launch.
Example policie:
What is the correct way to load the policies for firefox browser?
PD: I try put the policy of the binary download folder for the firefox browser for playwright and not work, any idea how to do this?
/home/user/.cache/ms-playwright/firefox-1357/firefox
And apologies for my basic english
The text was updated successfully, but these errors were encountered: